|
-
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
-
Mar 23rd, 2004, 10:45 AM
#2
Frenzied Member
are you wanting something that runs in the background contantly and monitors ALL of the computer's cpu usage? I think that may be in the processThread class. I'll see what I can find. in the meatime, lookup processThread in the msdn with your visual basic
-
Mar 24th, 2004, 10:48 AM
#3
Thread Starter
Member
yeah, you could say that, some kinda program that only finds the processor usage information, using performance counters. I wasnt all 2 sure wat i was doing, the whole code might be wrong. but i have 2 use performance counters, so i cant use processthread. Thanks.
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
|