What do the statistics (usr, sys, cusr, csys, and CPU) outputted by Perl's prove command mean?
Asked Answered
H

1

6

I've done quite a bit of Googling but can't find an answer to this question. When you run prove on your tests (http://perldoc.perl.org/prove.html), you get some statistics that look like:

Files=3, Tests=45,  2 wallclock secs ( 0.03 usr  0.00 sys +  0.50 cusr  0.12 csys =  0.65 CPU)

What do the numbers given for usr, sys, cusr, csys and CPU mean?

Harlequinade answered 15/6, 2014 at 4:39 Comment(0)
G
2

Wallclock seconds is the actual elapsed time, as if you looked at your watch to time it.

The usr seconds in the time actually spent on the CPU, in user space.

The sys seconds is the time actually spent on the CPU, in kernel space.

The CPU time is the total time spent on the CPU.

I don't know what cusr and csys represents, I guess they mean children_user and children_system?

Gelatin answered 15/6, 2014 at 4:43 Comment(4)
Thank you Chankey - do you know what cusr and csys mean also?Harlequinade
I'm not sure what they mean @KeithBroughtonGelatin
It should be pointed out, if your HARNESS_OPTIONS env variable is set for parallel testing, 'usr' time will usually be more than wallclock time, since each CPU core contributes to the cumulative usr time. In other words, four cores each working for 1 second is 4 usr seconds, but only 1 wallclock second.Diffusion
I think @ChankeyPathak's guess is correct: perldoc -f times => "Returns a four-element list giving the user and system times in seconds for this process and any exited children of this process."Wakeen

© 2022 - 2024 — McMap. All rights reserved.