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 |
string | The first event name. |
right |
string | The second event name. |
Returns:
The time between events, or null if not found.
- Type
- number | null
clear(event) → {void}
Remove an event timestamp. The timestamp "tick" is removed from TimerMetrics#events events.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event name. |
Returns:
- Type
- void
dump() → {TimerMetrics}
Output the timer metrics.
Returns:
The timing and count of all "tick" events tracked thus far.
- Type
- TimerMetrics
end(methodName) → {void}
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. |
Returns:
- Type
- void
start(methodName) → {void}
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. |
Returns:
- Type
- void
tick(event) → {void}
Add or update an event timestamp. The timestamp "tick" is added to TimerMetrics#events events.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event name. |
Returns:
- Type
- void