Resolves a time duration spec and return the quantity of given units.
Examples:
const hour = resolveTimeDuration("60m", "h") // 1const seconds = resolveTimeDuration("1.5m", "s") // 90const millis = resolveTimeDuration("20s") // 20_000 Copy
const hour = resolveTimeDuration("60m", "h") // 1const seconds = resolveTimeDuration("1.5m", "s") // 90const millis = resolveTimeDuration("20s") // 20_000
Duration spec.
Unit to convert to. If omitted, it will resolve to ms.
Resolves a time duration spec and return the quantity of given units.
Examples: