I want to output the number of context switches that are performed by the windows OS while executing my program.
            Asked
            
        
        
            Active
            
        
            Viewed 1,108 times
        
    3
            
            
        1 Answers
1
            
            
        You can use Performance-counter for this purpose.
From : http://msdn.microsoft.com/en-us/library/aa373083%28VS.85%29.aspx
You can view context switch data in two ways:
- The System\Context Switches/sec counter in System Monitor reports systemwide context switches.
 - The Thread(_Total)\Context Switches/sec counter reports the total number of context switches generated per second by all threads.
 
        Akshatha Merve
        
- 41
 - 4
 
"01/27/2013 18:45:48.528","112.35574813481777"
If I write anything in notepad then the value is as below: "01/27/2013 18:47:28.340","3418.9313164256719"
"01/27/2013 18:47:29.346","2197.8973136579948"
– Ganapa Jan 27 '13 at 13:20