fix time_duration rounding on windows
This commit is contained in:
parent
2aa1981ae3
commit
3dbe57bc5c
|
@ -166,7 +166,7 @@ namespace libtorrent
|
||||||
boost::int64_t ret = (pc * 1000 / performace_counter_frequency.QuadPart) * 1000;
|
boost::int64_t ret = (pc * 1000 / performace_counter_frequency.QuadPart) * 1000;
|
||||||
TORRENT_ASSERT((pc >= 0 && pc >= ret) || (pc < 0 && pc < ret));
|
TORRENT_ASSERT((pc >= 0 && pc >= ret) || (pc < 0 && pc < ret));
|
||||||
#endif
|
#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)
|
boost::int64_t microseconds_to_performance_counter(boost::int64_t ms)
|
||||||
|
|
Loading…
Reference in New Issue