title: How to count context switches programmatically?
body: <p>Under windows, is there anyway to programmatically count context switches of the same process? The best thing is a callback that gets called whenever a thread is switched.</p>