开发者

How to go from CPU time to CPU utilization?

开发者 https://www.devze.com 2022-12-16 17:16 出处:网络
I\'m trying to recognize a run away threads in my own application and close them for good before they render machine inaccessible.

I'm trying to recognize a run away threads in my own application and close them for good before they render machine inaccessible.

However, I can only get CPU time for the thread, that is limitation of API I'm using. Is there any way to evaluate CPU utilization from that da开发者_开发百科ta?

I was thinking about comparing it to real time and if it is close - than that thread is loading CPU too much. What do you think about that heuristic, will it work?


CPU time divided by real time will give you CPU utilization.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号