in reply to Re^5: portable way to get system load average
in thread portable way to get system load average

By the time your code has obtained an instantaneous cpu load reading, it has changed.
True, but that's not what the OP wants. He mentions an interface to getloadavg which returns the average load of the past 1, 5 and 15 minutes.

Replies are listed 'Best First'.
Re^7: portable way to get system load average
by BrowserUk (Patriarch) on Jul 07, 2010 at 14:55 UTC

    I know. But as I already pointed out, basing real-time decisions upon what happened 128 billion clock cycles ago, is like trying to play the stock market based upon event that happened circa the building of the Great Pyramid. And that's just the 1 minute figure... the other two are geometrically more useless.

    As any day-trader will tell you, even the 20 minute delay of the popular "free" stock market quotes is waaay too long.

      i think you lost me.

      the 1 minute means a simple rolling average, not "1 minute ago". i am making the decision based on an average calculated for "128 billion cycles" up to "just before now", not "128 billion cycles ago". that number is "good enough" indicator for my purposes.