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?

Keith Broughton
  • 487
  • 5
  • 9

1 Answers1

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?

Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133
  • Thank you Chankey - do you know what cusr and csys mean also? – Keith Broughton Jun 15 '14 at 04:46
  • I'm not sure what they mean @KeithBroughton – Chankey Pathak Jun 15 '14 at 05:13
  • 1
    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. – DavidO Jun 15 '14 at 07:16
  • 4
    I think @ChankeyPathak's guess is correct: [perldoc -f times](http://perldoc.perl.org/functions/times.html) => "Returns a four-element list giving the user and system times in seconds for this process and any exited children of this process." – oylenshpeegul Jun 15 '14 at 15:54