Can a C# program measure its own CPU usage somehow?

后端 未结 5 953
名媛妹妹
名媛妹妹 2020-12-12 18:54

I am working on a background program that will be running for a long time, and I have a external logging program (SmartInspect) that I want to feed with some values periodic

5条回答
  •  情书的邮戳
    2020-12-12 19:35

    This code project article describes how to use the high performance timer:

    http://www.codeproject.com/KB/cs/highperformancetimercshar.aspx

    You can use it to time the execution of your code.

    Here you can find a number of open source C# profilers:

    http://csharp-source.net/open-source/profile

提交回复
热议问题