Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Milliseconds

Represents a duration in milliseconds

example

Create with number

const milliseconds = new Milliseconds(1000);
milliseconds.toString();  // -> '1000ms'
`${milliseconds}`;  // -> '1000'
+milliseconds;  // -> 1000
milliseconds.value;  // -> 1000
example

Create with a milliseconds instance

const previous = new Milliseconds(1000);
const milliseconds = new Milliseconds(previous);
milliseconds.toString();  // -> '1000ms'

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

max

max: number

min

min: number

Accessors

value

  • get value(): number
  • set value(value: number): void

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): string | number

__@toStringTag

  • __@toStringTag(): string

get

  • get(): number

set

toJSON

  • toJSON(_?: string): any | number | string | boolean | null
  • Converts the primitive into it's JSON representation

    Parameters

    • Default value _: string = ""

    Returns any | number | string | boolean | null

    the object to serialize with JSON.stringify

toString

  • toString(): string

valueOf

  • valueOf(): number