Clockwork

Clockwork is a TypeScript-first, modular game engine workspace focused on ECS-driven runtime systems and a WebGL2 renderer stack.

Runnable Examples: Scheduler

Runnable Examples: Scheduler

Ordered Systems

import { Scheduler } from 'qti-clockwork-scheduler'

const calls = []
const mk = (id, order) => ({
  id,
  stage: 'Update',
  order,
  reads: [],
  writes: [],
  execute() {
    calls.push(id)
  }
})

const scheduler = new Scheduler()
scheduler.addSystem('Update', mk('A', 20))
scheduler.addSystem('Update', mk('B', 10))
scheduler.run()
await scheduler.step(1 / 60)
console.log(calls) // ['B', 'A']

Fixed-Step Configuration

const scheduler = new Scheduler({
  time: { fixedDelta: 1 / 120, maxCatchUpSteps: 8 }
})

Determinism Report

import { DeterminismValidator } from 'qti-clockwork-scheduler'

const report = new DeterminismValidator(scheduler).report()
console.log(report.score, report.violations)
Last updated: February 17, 2026