A
A. Lewenberg
I am looking for a perl code fragment that, given a number n will take
roughly n seconds of CPU time to complete. Note well that I do not
care how much _real_ time it takes: I want it to take n seconds of CPU
time to finish. Even if the CPU time it takes is within 50% of n that
would be OK.
I realize I could just do some experiments with tight loops to find
some code that would do what I want, but that would probably only work
on my current machine. I would like the code to work on different
platforms and hardware configurations.
Has anyone done this sort of thing before?
Thanks.
roughly n seconds of CPU time to complete. Note well that I do not
care how much _real_ time it takes: I want it to take n seconds of CPU
time to finish. Even if the CPU time it takes is within 50% of n that
would be OK.
I realize I could just do some experiments with tight loops to find
some code that would do what I want, but that would probably only work
on my current machine. I would like the code to work on different
platforms and hardware configurations.
Has anyone done this sort of thing before?
Thanks.