Class: Timer

Timer()

new Timer()

The Timer used to measure player and playlist item QoE

Methods

between(left, right) → {number|null}

Get the difference between two events.

Parameters:
Name Type Description
left

The first event name.

right

The second event name.

Returns:
Type
number | null

clear(event)

Remove an event timestamp. The timestamp "tick" is removed from TimerMetrics#events events.

Parameters:
Name Type Description
event string

The event name.

dump() → {TimerMetrics}

Output the timer metrics.

Returns:
Type
TimerMetrics

end(methodName)

Finish timing a method. The time since start is added to TimerMetrics#sums sums.

Parameters:
Name Type Description
methodName string

The method or player state name.

start(methodName)

Start timing a method. Increment TimerMetrics count. If the method was already started, but not finished, it's start will be reset.

Parameters:
Name Type Description
methodName string

The method or player state name.

tick(event)

Add or update an event timestamp. The timestamp "tick" is added to TimerMetrics#events events.

Parameters:
Name Type Description
event string

The event name.