在performancecounter中返回零 [英] Return zero in performancecounter

查看:74
本文介绍了在performancecounter中返回零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我写了这段代码,但我不知道为什么它会返回零



Hi
I've written this code but I don't know why it will return zero

PerformanceCounter PC = new PerformanceCounter("Processor", "Elapsed Time", System);
Console.WriteLine (PC.NextValue().ToString());





我的尝试:



我在互联网上搜索并尝试了一些代码但没有工作



What I have tried:

I have search in internet and try some codes but didn't work it

推荐答案

PerformanceCounter类支持多种类别(选项)。这些都有详细记录。



您的代码将无法编译,这表明您尚未完成使用这些工具所需的基础研究。



尝试学习MS文档[ ^ ],以及这些CodeProject文章:[ ^ ],[ ^ ]
The PerformanceCounter class supports a wide range of Categories (options). These are well documented.

Your code will not compile, and it indicates you have not done the basic research necessary to use these tools.

Try studying the MS docs [^] , and these CodeProject articles: [^], [^]


这篇关于在performancecounter中返回零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆