Class: shaka.timer

A performance timing framework. Used in both debugging and production builds.

Source:

Members

(private, static) now_ :function(): number

Type:
  • function(): number
Source:

(private, static, non-null) timers_ :Object.<string, {begin: number, end: number}>

Type:
  • Object.<string, {begin: number, end: number}>
Source:

Methods

(static) begin(name)

Begins a timer.
Parameters:
Name Type Description
name string
Source:

(static) diff(name1, name2, …var_args) → {number}

Log (debug) the diff between two or more completed timers and return it. Does nothing if not all of the timers have begun.
Parameters:
Name Type Attributes Description
name1 string
name2 string
var_args string <repeatable>
Source:
Returns:
The diff between the timers, or NaN if they have not all completed.
Type
number

(static) end(name)

End a timer and log (debug) the elapsed time. Does nothing if the timer has not begun.
Parameters:
Name Type Description
name string
Source:

(static) get(name) → {number}

Query a timer.
Parameters:
Name Type Description
name string
Source:
Returns:
The elapsed time in milliseconds, if the timer is complete. Returns NaN if the timer doesn't exist or hasn't ended yet.
Type
number