mirror of
https://github.com/lz4/lz4.git
synced 2024-11-23 09:54:00 +08:00
Merge pull request #1486 from lz4/win_ptime
fix process time counter on Windows for very large files
This commit is contained in:
commit
7e79c1da1f
@ -115,9 +115,9 @@ static double cpuLoad_sec(clock_t cpuStart)
|
||||
FILETIME creationTime, exitTime, kernelTime, userTime;
|
||||
(void)cpuStart;
|
||||
GetProcessTimes(GetCurrentProcess(), &creationTime, &exitTime, &kernelTime, &userTime);
|
||||
assert(kernelTime.dwHighDateTime == 0);
|
||||
assert(userTime.dwHighDateTime == 0);
|
||||
return ((double)kernelTime.dwLowDateTime + (double)userTime.dwLowDateTime) * 100. / 1000000000.;
|
||||
return ( ((double)kernelTime.dwLowDateTime + (double)userTime.dwLowDateTime)
|
||||
+ ((double)kernelTime.dwHighDateTime + (double)userTime.dwHighDateTime) * (double)(1ULL << 32) )
|
||||
* 100. / 1000000000.;
|
||||
#else
|
||||
return (double)(clock() - cpuStart) / CLOCKS_PER_SEC;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user