duration
Converts a duration in milliseconds into a human-readable string that represents the duration in terms of days, hours, minutes, seconds, and optionally milliseconds.
Parameters
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
duration | number | false | Time measured in milliseconds. | |
useMili | boolean | true | false | Return duration with milliseconds or not. |
Returns
Example
duration(60100); // [ '1 Min' ]
duration(60100, true); // [ '1 Min', '100 ms' ]