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

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.

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)

Looks like “man n time” for timers. Specify iterations.