Re: [R] unix.time

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Wed, 26 Mar 2008 16:52:21 +0000 (GMT)

Where did you get that idea from? Not from the help page:

      'system.time' calls the function 'proc.time', evaluates 'expr',
      and then calls 'proc.time' once more, returning the difference
      between the two 'proc.time' calls.

      'unix.time' is an alias of 'system.time', for compatibility with
      S.

Value:

      A object of class '"proc_time"': see 'proc.time' for details.

and ?proc.time says

      'proc.time' returns five elements for backwards compatibility, but
      its 'print' method prints a named vector of length 3.  The first
      two entries are the total user and system CPU times of the current
      R process and any child processes on which it has waited, and the
      third entry is the írealó elapsed time since the process was
      started.

So, you get measurements of user and system CPU time _and_ elapsed time. E.g.

> system.time(Sys.sleep(1.7))

    user system elapsed
     0.0 0.0 1.7
> system.time(Sys.sleep(1.7))[3]

elapsed

    1.69

On Wed, 26 Mar 2008, Faheem Mitha wrote:

>
> Hi,
>
> As far as I can tell, The R function unix.time calculates elapsed CPU
> time. Is there a command within R to measure actual elapsed time (I think
> this is sometimes referred to as wall time)?
>
> For example, the time command from GNU time calculates the actual elapsed
> time, as far as I can tell.
>
> (Please CC me, I'm not subscribed.)
> Thanks, Faheem.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Received on Wed 26 Mar 2008 - 20:41:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 26 Mar 2008 - 21:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive