Pretty formatting of time intervals (difftime objects)
Arguments
- dt
A
difftime
object, a vector of time differences.- compact
If true, then only the first non-zero unit is used. See examples below.
See also
Other time:
pretty_ms()
,
pretty_sec()
Examples
pretty_dt(as.difftime(1000, units = "secs"))
#> [1] "16m 40s"
pretty_dt(as.difftime(0, units = "secs"))
#> [1] "0ms"