Duration()

Simple class used to turn durations into a human readable format.

new Duration()

Constructs our duration class so that we can start formatting.

Members

day :number

The number of milliseconds in one day.

hour :number

The number of milliseconds in one hour.

minute :number

The number of milliseconds in one minute.

second :number

The number of milliseconds in one second.

week :number

The number of milliseconds in one week.

Methods

static format(time) → {string}

Formats a time that is given in milliseconds.
Parameters:
Name Type Description
time number The number of milliseconds we want to convert to a readable time.
Returns:
string - A human readable string of the time.