Options
All
  • Public
  • Public/Protected
  • All
Menu

A simple utility class for converting durations between minutes, seconds, and milliseconds.

Hierarchy

  • Duration

Index

Constructors

constructor

Properties

quantity

quantity: number

unit

unit: Unit

Static MILLIS_IN_SECONDS

MILLIS_IN_SECONDS: number = 1000

The number of milliseconds in one second.

Static SECONDS_IN_MINUTE

SECONDS_IN_MINUTE: number = 60

The number of seconds in one minute.

Accessors

milliseconds

milliseconds:

Returns the current number of milliseconds represented by this Duration instance.

minutes

minutes:

Returns the current number of minutes represented by this Duration instance, rounded to the nearest integer value.

seconds

seconds:

Returns the current number of seconds represented by this Duration instance, rounded to the nearest integer value.

Methods

Static milliseconds

  • milliseconds(quantity: number): Duration
  • Returns a new Duration instance created from the specified number of milliseconds.

    Parameters

    • quantity: number

      The number of milliseconds.

    Returns Duration

Static minutes

  • Returns a new Duration instance created from the specified number of minutes.

    Parameters

    • quantity: number

      The number of minutes.

    Returns Duration

Static seconds

  • Returns a new Duration instance created from the specified number of seconds.

    Parameters

    • quantity: number

      The number of seconds.

    Returns Duration