pub fn format(ms: i64, options: Option<Options>) -> StringExpand description
Format the given milliseconds as a string.
§Arguments
ms- milliseconds to formatoptions- Options for the conversion (uselongformat if specified)
§Returns
The formatted string
§Examples
use millis::{format, Options};
assert_eq!(format(60000, None), "1m");
assert_eq!(format(60000, Some(Options { long: true })), "1 minute");
assert_eq!(format(3600000, None), "1h");
assert_eq!(format(-3600000, None), "-1h");