Converts a duration in milliseconds to a human-readable string such as "1d 4h 32m 10s".
"1d 4h 32m 10s"
Sub-second values are rounded to the nearest second. Leading zero components are omitted except for seconds, which are always included.
Duration in milliseconds.
A formatted duration string.
millisecondsToString(3_661_000) // "1h 1m 1s"millisecondsToString(90_000) // "1m 30s"millisecondsToString(5_000) // "5s" Copy
millisecondsToString(3_661_000) // "1h 1m 1s"millisecondsToString(90_000) // "1m 30s"millisecondsToString(5_000) // "5s"
Converts a duration in milliseconds to a human-readable string such as
"1d 4h 32m 10s".Sub-second values are rounded to the nearest second. Leading zero components are omitted except for seconds, which are always included.