I found a tutorial on the internet about how to make a CPU meter in vb, but I want to make it count the process of all the cores I have. I have a dual core PC, but let's say that I want this program to detect how many cores I have, and count the processes on each individual core.
Now I have this code and I have no idea why it returns a single value, because I have two cores:
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim cpuLoad As Integer = CDec(PerformanceCounter1.NextValue.ToString())
cpuLoad = 100 - cpuLoad
Label1.Text = cpuLoad.ToString() & "%"
On Error Resume Next
ProgressBar1.Value = cpuLoad.ToString()
End Sub
Sorry, I forgot to say something about PerformanceCounter1:
CategoryName: Thread (I'm not shure if this helps but this is what the guy from the tutorial did)
CounterName: % processor time
InstanceName: idle/0