Skip to content

Commit

Permalink
fix Kernel32.GetSystemTimes usage on Windows (#84526)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxtfv authored Apr 9, 2023
1 parent 5147002 commit 2d062c0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal static double GetCpuUsage()
double cpuUsage = 0.0;

if (Interop.Kernel32.GetProcessTimes(Interop.Kernel32.GetCurrentProcess(), out _, out _, out long procKernelTime, out long procUserTime) &&
Interop.Kernel32.GetSystemTimes(out _, out long systemUserTime, out long systemKernelTime))
Interop.Kernel32.GetSystemTimes(out _, out long systemKernelTime, out long systemUserTime))
{
long totalProcTime = (procUserTime - s_prevProcUserTime) + (procKernelTime - s_prevProcKernelTime);
long totalSystemTime = (systemUserTime - s_prevSystemUserTime) + (systemKernelTime - s_prevSystemKernelTime);
Expand Down

0 comments on commit 2d062c0

Please sign in to comment.