|
-
Mar 22nd, 2004, 09:48 AM
#1
Thread Starter
Member
performance counters
Hi there, i'm tring to find the processor usage information, i.e. the CPU usage number u c in the task manager. I have the following code. i've used a timer control, so it can give me different values.
i'm a fairly new programmer, detailed answers will be highly appreciated. Thanks in advance.
Private Sub tmrDebug_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrDebug.Tick
Dim myPerformanceCounter1 As New PerformanceCounter("Processor", "% Processor Time", "_Total")
Dim myCounterSample1 As New CounterSample(10&, 20&, 30&, 40&, 50&, 60&, PerformanceCounterType.AverageCount64)
Console.WriteLine("RawValue = " & myCounterSample1.RawValue)
myCounterSample1 = myPerformanceCounter1.NextSample()
Console.WriteLine("RawValue = " & myCounterSample1.RawValue)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|