Performance Counter Question

C

Chortler

When I debug the following code, the label1.text holds a valid value
for the machines CPU. However, the string 's' holds a zero??
Any ideas??


Dim x As New System.Diagnostics.PerformanceCounter
Dim s As String
x.MachineName = "xp-ts01"
x.CategoryName = "Processor"
x.CounterName = "% Processor Time"
x.InstanceName = 0
s = x.NextValue
Me.Label1.Text = x.NextValue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top