[R] Extracing "Interval of Time" in seconds in R

Mohammad Ehsanul Karim wildscop at yahoo.com
Mon Apr 23 08:27:11 CEST 2007


The following seem to work:

begin.time<-Sys.time()
begin.times <- format(begin.time, "%a %b %d, %Y at
%X")
end.time<-Sys.time()
end.times <- format(end.time, "%a %b %d, %Y at %X")
run.time<-difftime(end.time,begin.time,units="secs")
cat(" Start time:", begin.times , "\n", "Finish
time:", end.times, "\n", "Run time:", run.time,
'secs.\n')


Thanks.

Mohammad Ehsanul Karim



More information about the R-help mailing list