How do you limit a process' CPU usage on Windows? (need code, not an app)

前端 未结 3 1358
离开以前
离开以前 2021-02-09 16:06

There is programs that is able to limit the CPU usage of processes in Windows. For example BES and ThreadMaster. I need to write my own program that does the same thing as these

3条回答
  •  故里飘歌
    2021-02-09 17:01

    You probably want to run the process(es) in a job object, and set the maximum CPU usage for the job object with SetInformationJobObject, with JOBOBJECT_CPU_RATE_CONTROL_INFORMATION.

提交回复
热议问题