win: return a floored double from uv_uptime()
This makes Windows consistent with other platforms. Refs: https://github.com/libuv/libuv/issues/1295 Fixes: https://github.com/libuv/libuv/issues/1294 PR-URL: https://github.com/libuv/libuv/pull/1296 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
1d1287d764
commit
61a8d97ad9
@ -587,8 +587,8 @@ int uv_uptime(double* uptime) {
|
||||
BYTE* address = (BYTE*) object_type + object_type->DefinitionLength +
|
||||
counter_definition->CounterOffset;
|
||||
uint64_t value = *((uint64_t*) address);
|
||||
*uptime = (double) (object_type->PerfTime.QuadPart - value) /
|
||||
(double) object_type->PerfFreq.QuadPart;
|
||||
*uptime = floor((double) (object_type->PerfTime.QuadPart - value) /
|
||||
(double) object_type->PerfFreq.QuadPart);
|
||||
uv__free(malloced_buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user