scheduler error correction via getTime

This commit is contained in:
Felix Roos 2022-08-21 11:20:15 +02:00
parent e72c47869a
commit 2172d1a767
2 changed files with 12 additions and 3 deletions

View file

@ -12,7 +12,7 @@ const createWorker = (func) => new Worker(urlifyFunction(func));
// this is just a setInterval with a counter, running in a worker
export class ClockWorker {
worker;
interval = 0.1; // query span
interval = 1 / 32; // query span, use powers of 2 to get better float accuracy
tick = 0;
constructor(callback, interval = this.interval) {
this.interval = interval;