I'm using a built-in benchmarking module for some quick and dirty tests. It gives me:
- CPU time
- system CPU time (actually I never get any result for this with the code I'm running)
- the sum of the user and system CPU times (always the same as the CPU time in my case)
- the elapsed real time
I didn't even know I needed all that information.
I just want to compare two pieces of code and see which one takes longer. I know that one piece of code probably does more garbage collection than the other but I'm not sure how much of an impact it's going to have.
Any ideas which metric I should be looking at?
And, most importantly, could someone explain why the "elapsed real time" is always longer than the CPU time - what causes the lag between the two?