fix time_duration rounding on windows

This commit is contained in:
Arvid Norberg 2013-06-19 04:22:21 +00:00
parent 2aa1981ae3
commit 3dbe57bc5c
1 changed files with 1 additions and 1 deletions

View File

@ -166,7 +166,7 @@ namespace libtorrent
boost::int64_t ret = (pc * 1000 / performace_counter_frequency.QuadPart) * 1000;
TORRENT_ASSERT((pc >= 0 && pc >= ret) || (pc < 0 && pc < ret));
#endif
return (pc * 1000 / performace_counter_frequency.QuadPart) * 1000;
return ((pc * 1000 + performace_counter_frequency.QuadPart / 2) / performace_counter_frequency.QuadPart) * 1000;
}
boost::int64_t microseconds_to_performance_counter(boost::int64_t ms)