[fpc-pascal]Computer/Server uptime (Linux)
Marco van de Voort
marcov at stack.nl
Sat Jan 6 22:43:29 CET 2001
> anybody knows how to find out the time the computer is running under
> I want to display the same time the Linux program "top" is displaying
> in the top left corner (ex. "up 27 days, 23:26").
> Is that possible? If yes, how?
> And (less important) maybe also the current IDLE level (ex. "99.2%")?
Try to pipe uptime (perhaps with some params) and parse it..
Or (more fundamentally), reverse engineer it, or the program top. The
calls that are used are probably sysctl.
Marco van de Voort (MarcoV at Stack.nl or marco at freepascal.org)
More information about the fpc-pascal