pretty_ms: Pretty formatting of milliseconds

Description Usage Arguments Value See Also Examples

View source: R/time.R

Description

Pretty formatting of milliseconds

Usage

1
pretty_ms(ms, compact = FALSE)

Arguments

ms

Numeric vector of milliseconds

compact

If true, then only the first non-zero unit is used. See examples below.

Value

Character vector of formatted time intervals.

See Also

Other time: pretty_dt(), pretty_sec()

Examples

1
2
3
4
pretty_ms(c(1337, 13370, 133700, 1337000, 1337000000))

pretty_ms(c(1337, 13370, 133700, 1337000, 1337000000),
          compact = TRUE)

Example output

[1] "1.3s"            "13.4s"           "2m 13.7s"        "22m 17s"        
[5] "15d 11h 23m 20s"
[1] "~1.3s"  "~13.4s" "~2m"    "~22m"   "~15d"  

prettyunits documentation built on Jan. 24, 2020, 9:06 a.m.