# [R] How much time a process need?

R. Michael Weylandt michael.weylandt at gmail.com
Mon Nov 7 15:12:49 CET 2011

```Alaios:

Generally I would think you would look at the elapsed field (at least
I do): consider the example you ran to give that data. Did it take
about half a second or a minute?

Gabor showed this example once to illustrate the difference:

system.time(Sys.sleep(20))

Michael

PS -- If you really want to dig into this, try this set of tools:

On Mon, Nov 7, 2011 at 8:40 AM, Joshua Wiley <jwiley.psych at gmail.com> wrote:
> On Mon, Nov 7, 2011 at 5:32 AM, Alaios <alaios at yahoo.com> wrote:
>> So I just need to get the
>>
>>    user  system elapsed
>>   0.460   0.048  67.366
>>
>>
>> user value and convert the seconds to days and then to hours ? Right?
>>
>
> It's all in seconds.  Convert whatever fields you want.
>
> Josh
>
>>
>> ________________________________
>> From: Uwe Ligges <ligges at statistik.tu-dortmund.de>
>>
>> Cc: "R-help at r-project.org" <R-help at r-project.org>
>> Sent: Monday, November 7, 2011 1:27 PM
>> Subject: Re: [R] How much time a process need?
>>
>>
>>
>> On 07.11.2011 11:09, Alaios wrote:
>>> Dear all,
>>> I have finished a large function that takes around 1 day to finish.
>>> I was using system.time(callmyfunction()) to measure how much time it needed to finish, my problem is that I do not know how to interpret their numbers.
>>> I was looking to convert these results to something more readably like.
>>> "This function took 1 Day 2 hours and 35 minutes to complete."
>>>
>>> How I can convert the system.time output to something like that?
>>
>>
>> system.time() responds in seconds, hence you can apply simple arithmetic
>> to get days, hours and minutes.
>>
>> Uwe Ligges
>>
>>
>>
>>>
>>> B.R
>>> Alex
>>>
>>>     [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> and provide commented, minimal, self-contained, reproducible code.
>>        [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
>
>
> --
> Joshua Wiley
> Ph.D. Student, Health Psychology
> Programmer Analyst II, ATS Statistical Consulting Group
> University of California, Los Angeles
> https://joshuawiley.com/
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help