Time

Contains static methods for time related calculations and parsing

Source:

Methods

(inner) .difference(a: number, b: number)Difference

Return a Difference object representing the time difference between a and b

Parameters:
Name Type Description
a
number

First time in MS

b
number

Second time in MS

Source:
Returns:
Difference

(inner) .duration(time: number)Difference

Return a Difference object (for convenience) measuring the duration of the given MS

Parameters:
Name Type Description
time
number

The time in MS

Source:
Returns:
Difference

(inner) .parseShorthand(shorthand: string) → number

Parse a duration shorthand string and return the duration in ms

Shorthand examples: 10m, 5h, 1d

Parameters:
Name Type Description
shorthand
string

The shorthand to parse

Source:
Returns:
number