Returns the time duration as a string with units.
Example:
const days = timeDurationToString(0.5 * 24 * 60 * 60 * 1_000, "d") // 0.5 Copy
const days = timeDurationToString(0.5 * 24 * 60 * 60 * 1_000, "d") // 0.5
Duration to convert.
Unit to convert to. If omitted, a full string with multiple units is returned.
Returns the time duration as a string with units.
Example: