|
Prev: WM6 on a HTC Touch and SQL
Next: For Sale:Apple Iphone 16GB,Nokia N95 8GB,Samsung Q1,Play Station3,Xbox 360
From: Vipul Pathak on 20 Mar 2008 22:11 Hello Everyone, I am designing a Task Manager for Windows Mobile Smartphone. I am using CreateToolhelp32Snapshot() to gether process information. I have an additional need to including CPU usage and Battery consumption by every process. Does any one has an Idea of how to detect CPU Usage and Battery Usage by a given process on the Device ? Thanks in Advance, *(Vipul)() ;
From: "Paul G. Tobey [eMVP]" p space tobey no spam AT no instrument no spam DOT on 21 Mar 2008 11:07 There's no way to get "battery usage" for a process. That doesn't make sense. As for CPU, look at GetThreadTimes() and add up the times for all threads in each process. Paul T. "Vipul Pathak" <vpathak_NoSpam(a)boxtoneRemoveThis.com> wrote in message news:uutDwjviIHA.5504(a)TK2MSFTNGP05.phx.gbl... > Hello Everyone, > > I am designing a Task Manager for Windows Mobile Smartphone. I am using > CreateToolhelp32Snapshot() to gether process information. I have an > additional need to including CPU usage and Battery consumption by every > process. > > Does any one has an Idea of how to detect CPU Usage and Battery Usage by a > given process on the Device ? > > Thanks in Advance, > > *(Vipul)() ; > >
From: Vipul Pathak on 21 Mar 2008 11:30
Thanks Paul ... In order to get the CPU usage in percentage, I will be using the following Algorithm: T1, T2, Tn are threads of their respective processes P1, P2, Pn etc. ========================================= Time_P1 = (GetThreadTimes(T1)+GetThreadTimes(T2)+ ..... GetThreadTimes(Tn)) ; Time_P2 = (GetThreadTimes(T1)+GetThreadTimes(T2)+ ..... GetThreadTimes(Tn)) ; . . . Time_Pn = (GetThreadTimes(T1)+GetThreadTimes(T2)+ ..... GetThreadTimes(Tn)) ; Total Time Consumed (lets call this: TTC) = Time_P1 + Time_P2 + ...... + Time_Pn ; CPU Usage for P1 = (Time_P1 / TTC) * 100 ; CPU Usage for P2 = (Time_P2 / TTC) * 100 ; . . . CPU Usage for Pn = (Time_Pn / TTC) * 100 ; ========================================= If you or any one else think, that this should be corrected, please let me know. Thanks, *(Vipul)() ; "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com> wrote in message news:uzdn$U2iIHA.1164(a)TK2MSFTNGP02.phx.gbl... > There's no way to get "battery usage" for a process. That doesn't make > sense. > > As for CPU, look at GetThreadTimes() and add up the times for all threads > in each process. > > Paul T. > > "Vipul Pathak" <vpathak_NoSpam(a)boxtoneRemoveThis.com> wrote in message > news:uutDwjviIHA.5504(a)TK2MSFTNGP05.phx.gbl... >> Hello Everyone, >> >> I am designing a Task Manager for Windows Mobile Smartphone. I am using >> CreateToolhelp32Snapshot() to gether process information. I have an >> additional need to including CPU usage and Battery consumption by every >> process. >> >> Does any one has an Idea of how to detect CPU Usage and Battery Usage by >> a given process on the Device ? >> >> Thanks in Advance, >> >> *(Vipul)() ; >> >> > > |