This project is based on this blog post by Paul Colby, and the Bash version comes from there. To get a more real-time utilization, we simply repeat the steps above with some small sleep interval in between, and instead of using the absolute total and idle times, we use use the total time delta and the idle time delta to compute the utilization. So the steps above will give the total CPU utilization since boot, which may or may not be useful to some. The times in /proc/stat are monotonically increasing, and begin at some point during the kernel's initialization (ie during boot up).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |