Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TimeSpan

A Time Span represents a certain span of time.

Hierarchy

Index

Constructors

constructor

  • This constructor is an implementation detail. Do not use this.

    Parameters

    • ptr: number

    Returns TimeSpan

Properties

ptr

ptr: number

Methods

clone

dispose

  • dispose(): void
  • Disposes the object, allowing it to clean up all of its memory. You need to call this for every object that you don't use anymore and hasn't already been disposed.

    Returns void

totalSeconds

  • totalSeconds(): number
  • Returns the total amount of seconds (including decimals) this Time Span represents.

    Returns number

with

  • with<T>(closure: (obj: TimeSpan) => T): T
  • Allows for scoped usage of the object. The object is guaranteed to get disposed once this function returns. You are free to dispose the object early yourself anywhere within the scope. The scope's return value gets carried to the outside of this function.

    Type parameters

    • T

    Parameters

    Returns T

Static fromSeconds

  • Creates a new Time Span from a given amount of seconds.

    Parameters

    • seconds: number

    Returns TimeSpan

Static parse

  • Parses a Time Span from a string. Returns null if the time can't be parsed.

    Parameters

    • text: string

    Returns TimeSpan

Generated using TypeDoc