获得系统性能的问题 [英] Problem in Getting System Perfomnce
问题描述
亲爱的,亲爱的,
我正在使用性能计数器获取PC的整体CPU使用率
System.Diagnostics .PerformanceCounter(处理器,%处理器时间,_总计)
公共功能GetOVerAllCPUUsage()
尝试
返回m_PerformanceCounter.NextValue()
Catch Ex As Exception
结束尝试
结束功能
其中我一直有0值
请给我准确的sol来获取系统CPU使用率
你的意思是这样的:
MyLabel。 Text = CPU使用率:& CInt (PerformanceCounter1.NextValue).ToString
希望这会有所帮助! ;)
Dear Dear,
I am using performance Counter for Getting overall CPU usage for PC
Private m_PerformanceCounter As New _
System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total")
Public Function GetOVerAllCPUUsage()
Try
Return m_PerformanceCounter.NextValue()
Catch Ex As Exception
End Try
End Function
In which i was got 0 value all time
Pls Give me exact sol for getting system CPU usage
You mean like this:
MyLabel.Text = "CPU Usage: " & CInt(PerformanceCounter1.NextValue).ToString
Hope this helps! ;)
这篇关于获得系统性能的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!