On Feb 5, 2008 9:12 AM, Karl Cunningham <[EMAIL PROTECTED]> wrote:
> On 2/5/2008 8:22 AM, kelsey hudson wrote:
>
> > to make use of this information, poll on /proc/stat every n seconds.
> > take the current value and subtract from it the previous value, and you
> > have the delta. divide this by n seconds times USER_HZ (typically 100,
> > but being careful not to ?DIV/0!) and you have an average percentage of
> > CPU utilization in each time slice. viola, wasn't that easy?
>
> For extra credit write a Perl one-liner to do the above.

That would be the moral equivalent of
     $ top -n1 | grep Cpu

which is a one-command-liner.

    carl

-- 
    carl lowenstein         marine physical lab     u.c. san diego
                                                 [EMAIL PROTECTED]


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to