CPU Usage in Task Manager using Performance Counters

前端 未结 3 1288
南方客
南方客 2021-01-17 06:22

[My Attempts]

Already went through

  1. How to get the CPU Usage in C#? But \"_Total\" Instance of Processor would give me total consumption of CPU as o

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-17 06:44

    If you use this, you can get the same result with the task manager :

    cpuCounter = new PerformanceCounter(
            "Processor Information",
            "% Processor Utility",
            "_Total",
            true
        );
    

提交回复
热议问题