Learn R Programming

humanFormat (version 1.2)

formatDuration: Format nanosecond durations into human readable strings.

Description

Format individual or vectors of durations into human friendly text.

Usage

formatDuration(ns)
  formatNanoseconds(ns)

formatMicroseconds(us) formatMilliseconds(ms) formatSeconds(s)

Arguments

ns

Duration in nanoseconds

us

Duration in microseconds

ms

Duration in milliseconds

s

Duration in seconds

See Also

durationConstants constants for various duration lengths

Examples

Run this code
  formatDuration(0)
  formatDuration(1)
  formatNanoseconds(34)

  formatMicroseconds(235)

  formatMilliseconds(2487)

  formatSeconds(7213)

  formatDuration(c(0, 1, 1000, 2039, 205958, 284859249525))

Run the code above in your browser using DataLab