constructor(options?: TimerOptions)
View sourceCreates a timer with an optional duration, mode, speed, and paused state.
Class
ExtendsTimer
Timer resource used by diagnostic tools to track completed frame-rate cycles.
RAFTimer extends Timer and provides the timing behavior used by
diagnostic consumers.
import { RAFTimer } from '@wimaengine/diagnostic'
function readFpsCycle(world) {
const timer = world.getResource(RAFTimer)
if (timer.cycleStarted()) {
console.log('a diagnostic timer cycle completed')
}
}constructor(options?: TimerOptions)Creates a timer with an optional duration, mode, speed, and paused state.