Chooses microseconds, milliseconds, seconds, or minutes and seconds based on the size of each duration, and rounds to three significant digits.
Examples
format_duration(c(0.0000123, 0.0456, 1.234, 75, 4000))
#> [1] "12.3 µs" "45.6 ms" "1.23 s" "1m 15s" "1h 6m 40s"
