Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
Update the CPU monitoring interval.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntINFINAit authored and AntINFINAit committed Nov 7, 2020
1 parent 57fc05a commit 83b178d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private void DoCount()
{
_startTime = DateTime.Now;
_startUsage = ProcessCtx.TotalProcessorTime;
Thread.Sleep(1000); //should be good enough for the future.
Thread.Sleep(500); //should be good enough for the future.
_endTime = DateTime.Now;
_endUsage = ProcessCtx.TotalProcessorTime;
this.CpuUsage = (int)((((_endUsage - _startUsage).TotalMilliseconds) / (Environment.ProcessorCount * ((_endTime - _startTime).TotalMilliseconds))) * 100);
Expand Down

0 comments on commit 83b178d

Please sign in to comment.