[R] get time as a number

Dimitris Rizopoulos d.rizopoulos at erasmusmc.nl
Sun Sep 19 15:36:32 CEST 2010


probably you want to use proc.time() -- have a look at the corresponding 
help file.


I hope it helps.

Best,
Dimitris


On 9/19/2010 3:19 PM, Hyunchul Kim wrote:
> Hi, all,
>
> How to get a time as a number?
>
> While script is running, I want to print the elapsed time
>
> something like TIME_AS_SECOND() in the following script
>
> inittime<- TIME_AS_SECOND()
> for (i in 1:100){
>      do_something(i)
>      curtime<- TIME_AS_SECOND()
>      elapsedtime<- curtime-inittime
>      print(paste(i, elapsedtime))
> }
>
> Thanks in advance,
>
> Hyunchul
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

-- 
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center

Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014



More information about the R-help mailing list