Chromium Code Reviews| Index: util/misc/clock_win.cc |
| diff --git a/util/misc/clock_win.cc b/util/misc/clock_win.cc |
| index 731e98d4ee29da76306d598f4ee02ec64cffa99d..7231205decef22842a4a65745dcfe268ed40e0c6 100644 |
| --- a/util/misc/clock_win.cc |
| +++ b/util/misc/clock_win.cc |
| @@ -39,7 +39,7 @@ uint64_t ClockMonotonicNanoseconds() { |
| QueryPerformanceCounter(&time); |
| int64_t frequency = QpcFrequency(); |
| int64_t whole_seconds = time.QuadPart / frequency; |
| - int64_t leftover_ticks = time.QuadPart / (whole_seconds * frequency); |
| + int64_t leftover_ticks = time.QuadPart % frequency; |
|
scottmg
2015/11/05 18:49:58
frequency = 10, time.QuadPart = 98
whole_seconds
Mark Mentovai
2015/11/05 18:58:10
scottmg wrote:
|
| const int64_t kNanosecondsPerSecond = static_cast<const int64_t>(1E9); |
| return (whole_seconds * kNanosecondsPerSecond) + |
| ((leftover_ticks * kNanosecondsPerSecond) / frequency); |