On Thu, Jan 14, 2010 at 10:50 PM, Sebastian Spies
<sebastian.spies@de-cix.net> wrote:
You want the load of a process on a per second basis - that actually is.
Consider this diff:
--- cpucalc-old.c Fri Jan 15 21:46:32 2010
+++ cpucalc.c Fri Jan 15 21:44:55 2010
@@ -30,7 +30,7 @@
exit(1);
}
- printf("%x\n",info->p_cpticks);
+ printf("%x in %x\n",info->p_pctcpu, info->p_swtime);
exit(0);
}
And this test run:
# while sleep 1; do ./cpucalc 21380; done
0 in 15ca3
0 in 15ca4
0 in 15ca5
^C
So there it is - it already is calculated on a per second basis for you.
HTH
--
Aaron Mason - Programmer, open source addict
I've taken my software vows - for beta or for worse