Convert milliseconds to a human readable string: 133700000015d 11h 23m 20s.

import formatMilliseconds from '@oliversalzburg/js-utils/format/milliseconds.js';

formatMilliseconds(1337000000);
//=> '15d 11h 23m 20s'

formatMilliseconds(1337);
//=> '1.3s'

formatMilliseconds(133);
//=> '133ms'

// `compact` option
formatMilliseconds(1337, {compact: true});
//=> '1s'

// `verbose` option
formatMilliseconds(1335669000, {verbose: true});
//=> '15 days 11 hours 1 minute 9 seconds'

// `colonNotation` option
formatMilliseconds(95500, {colonNotation: true});
//=> '1:35.5'

// `formatSubMilliseconds` option
formatMilliseconds(100.400080, {formatSubMilliseconds: true})
//=> '100ms 400µs 80ns'

// Can be useful for time durations
formatMilliseconds(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5))
//=> '35m'