I found the problem.  It's because vmstat when called always, 
initially has the cpu idle at 99.  This explains it.  So, how would I go 
abouts returning used cpu time on a system?


Paul A. Procacci wrote:

> Hey all,
>     I'm trying not to cache a page.  I have the following code:
>        $return = split(" ", exec("vmstat"));
>        $cpu_top = 100;
>        $return = $cpu_top - $return[count($return) -1];
> which returns the amount of idle cpu time.  The problem is this, every 
> time the page is loaded, it always show the first value when the page 
> was first loaded.   I tried adding :
> header("Cache-Control: no-store, no-cache, must-revalidate");
> header("Cache-Control: post-check=0, pre-check=0", false);
> header("Pragma: no-cache");
> all randomly, and together, but nothing seems to work.  I can run one 
> of my binaries in a forever loop causing the cpu not ever to be idle, 
> but still nothing.  Help?
> Thanks in advance,
> Paul

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to