On Tuesday 05 Jul 2005 12:19 pm, Yogesh1 Talekar wrote: hi,
Hope this may help. Have a look at /proc/stat Find user(Tu),nice(Tn),sys(Ts) and ideal(Ti) usage in jiffies for some small time duration(T in jiffies). %usage Total = (Tu+Tn+Ts+Ti)*100 / T Same should be true for each process /proc/PID/stat which ps uses. Warm Regards > Hello all, > > Is there anyway to calculate %CPU usage from /proc/stat file's contents? > Somehow, 'top' on my machine is broken (and I want to avoid using it as > well !). > > I googled a bit but couldn't get definitive answer. > > Plz advice / help > > Thanks in advance > > --yogesh > > -- > ______________________________________________________________________ > Pune GNU/Linux Users Group Mailing List: ([email protected]) > List Information: http://plug.org.in/mailing-list/listinfo/plug-mail > Send 'help' to [EMAIL PROTECTED] for mailing instructions. -- ______________________________________________________________________ Pune GNU/Linux Users Group Mailing List: ([email protected]) List Information: http://plug.org.in/mailing-list/listinfo/plug-mail Send 'help' to [EMAIL PROTECTED] for mailing instructions.
