Getting a per thread CPU statistics

For a quick answer use SysInternal's Process Explorer. Double click on a process to open the details dialogue. the threads tab gives a sortable list of all threads including context switch delta and CPU time.


Perfmon (Performance Monitor) should give you the details you want.

The following assumes Windows 2000, XP or Server 2003. I haven't checked but I think the performance monitor is a bit different in Vista, Windows 7 & Server 2008.

To run the Performance Monitor, go to Start > Control Panel > Administrative Tools > Performance

To add a graph for each thread of an application, right-click on the graph and choose Properties. You might want to remove any of the defaults that it comes with to give you a cleaner graph.

Click the "Add..." button and make sure "Use Local Computer Counters" is checked (unless you want to monitor a different server, in which case, go ahead and choose that option).

Under "Performance Object" choose "Thread"

Select the counter "% Processor Time", and then select all of the threads you wish to monitor (control+click to select multiple). Click "Add" and then "Close".

Back in the properties, you can customise the graph however you wish, by assigning colours, patterns, etc. Click OK.

You might need to start the graphing, if you do, then clicking the red STOP sign so that it's not enabled will start the graph.