as.time: Convert time (sec) into human readable string (day hr min...

View source: R/as.time.R

as.timeR Documentation

Convert time (sec) into human readable string (day hr min sec)

Description

Converts an elapsed time (in seconds) into a human readable string. String is output in units decreasing from the largest integer unit of day/hour/min/sec. If the time is greater than 1 day, seconds are not printed.

Usage

as.time(sec,digits)

Arguments

sec

Elapsed time in seconds

digits

Number of decimal places to use when reporting smalled time unit

Value

string: time elapsed in Day, Hr, Min, Sec.

Author(s)

Angus H Wright AIfA awright@astro.uni-bonn.de

Examples


elapsed.time <- Sys.time()
for (i in 1:6) { 
  print(as.time(10^i,digits=3))
}



AngusWright/LAMBDAR documentation built on May 12, 2022, 1:49 a.m.