Need help with getting correct CPU Utilization from "top"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
    I am using this code to dump "top" into a file thus be able to
read CPU utilization at a certain moment. The problem is that when I
am stressing the CPU with an infinite loop for example, it doesn't
give me the correct CPU utilization(which is 95% for example), it
gives me a small number which is prior to the infinite loop... I tried
sleep(); before opening the file i dumped it into but it didn't work
too

Can anyone help?
Thanks

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux