Write code to make CPU usage display a sine wave

后端 未结 5 602
无人及你
无人及你 2020-12-12 18:31

Write code in your favorite language and let Windows Task Manager represent a sine wave in CPU Usage History.

This is a technical in

5条回答
  •  渐次进展
    2020-12-12 19:10

    With the literally hundreds (thousands?) of threads a PC runs today, the only way I can think to even come close would be to poll CPU usage as fast as possible, and if the usage% was below where it should be on the curve, to fire off a short method that just churns numbers. That will at least bring the typical low usage UP where needed, but I can't think of a good way to LOWER it without somehow taking control of other threads, and doing something such as forcing thier priority lower.

提交回复
热议问题