format
Formats duration as a short human-readable string such as "1h 30m 5s".
Uses the units d, h, m, s and ms, largest first, and skips the ones that are zero. A
zero duration is "0s". Anything below one millisecond is dropped (truncated, not rounded).
parse reads the result back.
Import
Section titled “Import”Cargo feature duration (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
duration | Duration | The duration to format. |
Returns
Section titled “Returns”String
