How do I get percentage CPU usage of processes for a specified time interval?



How do I get percentage CPU usage of processes for a specified time
interval?

I'm wish to write a script, part of which displays the top 10
processes by percentage processor usage over a 30 second interval. I
know "topas" can show this, but I need to be able to process the
information in a script. The output from "ps" doesn't seem to give the
neccessary resolution...

Can anybody give me some pointers as to how this can be done?

Many Thanks,
=Adrian=

.



Relevant Pages

  • Re: a possible bug in expect/tcl: a hypothesis
    ... | monitors the CPU usage of all processes. ... | what is happening to my script. ... See ulimit -t. ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org ...
    (comp.lang.tcl)
  • Re: CPU limits
    ... I'd much prefer to be able to set my script's CPU usage at - say - 75% ... you can use BSD::Resource on linux. ... will use your script. ... sub CPU_used { ...
    (comp.lang.perl.misc)
  • BUG? IE6 Windows XP SP2: iexplore.exe ram is growing and growing...
    ... I have Windows XP SP2 installed and I am wondering using a short javascript ... the ram used by iexplore.exe is growing and growing. ... will have about 100% cpu usage. ... Another script error occured on a different script: ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • RE: How to get CPU Usage using C# .Net
    ... I have an C# application in which I am using WMI to obtain CPU ... Process and subtract it from 100 to obtain CPU Usage. ... This script is giving me valid Values. ... ManagementObject processor = new ManagementObject( ...
    (microsoft.public.win32.programmer.wmi)
  • Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?
    ... RF> script is for some other purpose, ... the number of socket clients connecting in the past 3-4 ... RF> data that used to take two weeks), the CPU usage of the machine goes ... RF> cycles it's operated, data processed, MySQL queries executed, etc.). ...
    (php.general)