Results 1 to 4 of 4

Thread: How to understand system.time

  1. #1

    Default How to understand system.time

    Dear all.
    (inside R) I am using system.time function to measure the execution time of two functions

    > system.time(lapply(seq(1:1000000),returni))
    user system elapsed
    0.982 0.100 1.057

    > system.time(mclapply(seq(1:1000000),returni))
    user system elapsed
    0.827 0.607 1.502


    As this system.time uses the unix time functions I would like to ask your help understand the output (user,system,elapses) so to figure out which of the two functions is faster or not.

    Regards
    Alex

  2. #2

    Default Re: How to understand system.time

    alaios wrote:
    > Dear all.
    > (inside R) I am using system.time function to measure the execution
    > time of two functions
    >
    >> system.time(lapply(seq(1:1000000),returni))

    > user system elapsed
    > 0.982 0.100 1.057
    >
    >> system.time(mclapply(seq(1:1000000),returni))

    > user system elapsed
    > 0.827 0.607 1.502
    >
    >
    > As this system.time uses the unix time functions I would like to ask
    > your help understand the output (user,system,elapses) so to figure out
    > which of the two functions is faster or not.


    To understand Linux commands, use the man pages: man time

    Which is faster depends on what you care about. You should also repeat
    the tests to be sure the values are reliable.

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to understand system.time

    On 2011-03-29 12:36, alaios wrote:
    >
    > Dear all.
    > (inside R) I am using system.time function to measure the execution
    > time of two functions
    >
    >> system.time(lapply(seq(1:1000000),returni))

    > user system elapsed
    > 0.982 0.100 1.057
    >
    >> system.time(mclapply(seq(1:1000000),returni))

    > user system elapsed
    > 0.827 0.607 1.502
    >
    >
    > As this system.time uses the unix time functions I would like to ask
    > your help understand the output (user,system,elapses) so to figure out
    > which of the two functions is faster or not.


    You would have to ask in the programming forum.
    Perhaps it is similar to the output of "uptime", or perhaps to "time
    some_command".

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  4. #4

    Default Re: How to understand system.time

    Looks like "man n time" for timers. Specify iterations.
    Box 1: OpenSuse 11.1/Win7 | Linux 2.6.27 Gnome | AMD 64 X2 6000+ | nVidia 8600GT | 2GB RAM
    Box 2: OpenSuse 11.2 | Linux 2.6.31 Gnome | AMD 64 3000+ | ATI X800 Pro | 1GB RAM
    Box 3: Win7 Premium Home | Intel P4 3.0Gz | ATI AIW 2006 | 2GB RAM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •