TotalPlaytimeCounter

A class for tracking the total playtime of something.

Parameters

timeProvider

A function that returns the current time, in milliseconds.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Calculates the total play time.

Link copied to clipboard
fun pause()

Pauses the tracking of total play time.

Link copied to clipboard
fun play()

Starts or resumes playback.

Link copied to clipboard
fun reset()

Resets the total playtime counter to zero.