File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ static char *process_title;
59
59
static CRITICAL_SECTION process_title_lock ;
60
60
61
61
/* Interval (in seconds) of the high-resolution clock. */
62
- static double hrtime_interval_ = 0 ;
62
+ static long hrtime_interval_ = 0 ;
63
63
64
64
65
65
/*
@@ -75,9 +75,9 @@ void uv__util_init() {
75
75
* and precompute its reciprocal.
76
76
*/
77
77
if (QueryPerformanceFrequency (& perf_frequency )) {
78
- hrtime_interval_ = 1.0 / perf_frequency .QuadPart ;
78
+ hrtime_interval_ = perf_frequency .QuadPart ;
79
79
} else {
80
- hrtime_interval_ = 0 ;
80
+ hrtime_interval_ = 1 ;
81
81
}
82
82
}
83
83
@@ -484,7 +484,7 @@ uint64_t uv__hrtime(double scale) {
484
484
* performance counter interval, integer math could cause this computation
485
485
* to overflow. Therefore we resort to floating point math.
486
486
*/
487
- return (uint64_t ) (( double ) counter .QuadPart * hrtime_interval_ * scale );
487
+ return (uint64_t ) (counter .QuadPart * ( long ) scale / hrtime_interval_ );
488
488
}
489
489
490
490
You can’t perform that action at this time.
0 commit comments