[Scottish] CPU Testing
Allan Whiteford
scottish at mailman.lug.org.uk
Thu Feb 27 16:37:02 2003
Iain Conochie wrote:
>
> Ian Drake, IT, CIR, SE Dunbartonshire wrote:
>
> >I'm currently setting up MRTG to graph my CPU usage, but I need something to
> >help prove what I've done works, anyone got a short piece of C code that'll
> >push the gas peddle on my Linux box and keep the cpu cycles high for a few
> >mins?
> >
> >
>
> Don't run this on a production box!!!!
>
> int main ()
>
> {
> fork()
> }
>
> That should stress your box to the level of killing it :)
>
Or, maybe it'll just fork and then both processes will end...
How about:
int main(void)
{
label:
fork();
goto label;
}
Thanks,
Allan
--
Intel: We put the 'um...' in Pentium.