Skip to content

pausable-clock overview


Table of contents


utils

PausableClock (class)

A class providing the ability to track time, fire ticks, provide time elapsed, and tick delta with the ability to suspend/resume it.

Signature

export declare class PausableClock {
  constructor(autoStart: boolean = false, protected readonly parentClock: IClock = GgGlobalClock.instance)
}

createChildClock (method)

Creates a child clock.

Signature

createChildClock(autoStart: boolean): PausableClock

start (method)

Starts the clock.

Signature

start()

stop (method)

Stops the clock.

Signature

stop()

pause (method)

Pauses the clock.

Signature

pause()

resume (method)

Resumes the clock.

Signature

resume()

startListeningTicks (method)

Starts listening for ticks from the parent clock.

Signature

protected startListeningTicks()

stopListeningTicks (method)

Stops listening for ticks from the parent clock.

Signature

protected stopListeningTicks()

tickRateLimit (property)

Tick rate limiter. If set to 0 - tick rate is unlimited, 15 means "allow at most 15 ticks per second"

Signature

tickRateLimit: number

paused$ (property)

Signature

readonly paused$: any