On almost any system, performance is monitored by counting not only the elapsed time ("wallclock seconds") but also "CPU seconds", or in other words the amount of time your process spends actually running on the CPU as opposed to sleeping or waiting for some other process (such as I/O) to complete. On Unix and Unix-like systems, CPU time is further subdivided into at least two classes, "user" and "system" time.

User time is time used by the CPU while running in your process's user space. This includes your code, as well as code such as the Perl interpreter itself or provided by a library/module.

System time is time used by the CPU while running in the operating system space on behalf of your process.

If you're on a Unix system, look at the man pages for time(1) and times(2) which are how Benchmark is probably implemented "under the hood". If you're on Windows, more than likely Perl is using either the Windows equivalent of the common Unix system calls above (any Windows based on the NT code base will have a POSIX subsystem that implements these system calls) or an emulation of them compiled into the Perl interpreter itself.


In reply to Re: benchmark: user vs system by bigmacbear
in thread benchmark: user vs system by schulerlab

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.