I'm trying to create a C# program which monitors the cpu level of vms within virtual server. I've created an event model to captured when the cpu reaches a certain level. What I am getting stuck on is the best way for me to actually poll the vs and determine when the cpu has hit a certain level. tried creating an infinite loop that will constantly pool the cpu level, however I'm never done any kind of thread base programming and my current approach will lock the execution of my program. Can anyone offer any advice on how I would create a monitoring program which constantly polls. If I should use different threads how should I create and manage them? Here is what I have so far and you'lll see why I'm having problems:
public void monitorCpuUtilization()
if (CPUUsageAverage > 10)
Al input welcome. Thanks.