Counting the number of context switches in program c while executing that program
1 answer
You can use a performance counter for this purpose.
From: http://msdn.microsoft.com/en-us/library/aa373083%28VS.85%29.aspx
You can view the context switch data in two ways:
- System \ Context Switches / Seconds Count in System Monitor reports general context switches.
- Topic (_Total) \ Context Switches / sec counter reports the total number of context switches generated per second by all threads.
+1
source to share