views:

1454

answers:

2

Is is possible to measure CPU per thread on a windows mobile (or CE 5) device programmatically (c++)? If not, is their a utility that will monitor the CPU usage of a process?

+4  A: 

CPU usage cannot be directly measured because, unlike an x86, the ARM processor doesn't have a register for it. You can calculate it using the Toolhelp APIs to get a list of processes and their child threads and then use GetThreadTimes to figure out how much time each thread is using.

Keep in mind that doing this calculation directly affects how much the CPU is in use.

ctacke
+3  A: 

Someone wrote a tool that looks a lot like Task Manager on the PC: http://www.vttoth.com/LPK/taskmanager.html

As ctacke says, it does seem to use a lot of the CPU. It reports uses ~15%-30% of our CPU on our 800MHz ARM device.

Aaron