timetaken is very handy function for formatting time taken in R code. It is currently limited to one type of format:
t0 = proc.time()
Sys.sleep(5)
timetaken(t0)
#[1] "5.007s elapsed (0.060s cpu)"
# then when something takes much longer
#[1] "01:01:33 elapsed (01:00:01 cpu)"
I would like to be able to tweak its format.
For example I would like to skip "cpu" time: "5.007s elapsed" / "01:01:33 elapsed"
Or skip elapsed word as well: "5.007s" / "01:01:33"
timetaken is very handy function for formatting time taken in R code. It is currently limited to one type of format:
I would like to be able to tweak its format.
For example I would like to skip "cpu" time: "5.007s elapsed" / "01:01:33 elapsed"
Or skip elapsed word as well: "5.007s" / "01:01:33"