add note to future
This commit is contained in:
parent
2fcbffeaf9
commit
8dba865ca7
2 changed files with 4 additions and 1 deletions
|
|
@ -1,5 +1,8 @@
|
|||
// eslint-disable-next-line no-undef
|
||||
importScripts('./neozyklus.js');
|
||||
// TODO: swap below line with above one when firefox supports esm imports in service workers
|
||||
// see https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker?retiredLocale=de#browser_compatibility
|
||||
// import createClock from './zyklus.mjs';
|
||||
|
||||
function getTime() {
|
||||
const precision = 10 ** 4;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ function createClock(
|
|||
// callback as long as we're inside the lookahead
|
||||
while (phase < lookahead) {
|
||||
phase = Math.round(phase * precision) / precision;
|
||||
phase >= t && callback(phase, duration, tick);
|
||||
phase >= t && callback(phase, duration, tick, t);
|
||||
phase < t && console.log('TOO LATE', phase); // what if latency is added from outside?
|
||||
phase += duration; // increment phase by duration
|
||||
tick++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue