mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 21:18:49 +00:00
add note to future
This commit is contained in:
parent
2fcbffeaf9
commit
8dba865ca7
@ -1,5 +1,8 @@
|
|||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
importScripts('./neozyklus.js');
|
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() {
|
function getTime() {
|
||||||
const precision = 10 ** 4;
|
const precision = 10 ** 4;
|
||||||
|
|||||||
@ -23,7 +23,7 @@ function createClock(
|
|||||||
// callback as long as we're inside the lookahead
|
// callback as long as we're inside the lookahead
|
||||||
while (phase < lookahead) {
|
while (phase < lookahead) {
|
||||||
phase = Math.round(phase * precision) / precision;
|
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 < t && console.log('TOO LATE', phase); // what if latency is added from outside?
|
||||||
phase += duration; // increment phase by duration
|
phase += duration; // increment phase by duration
|
||||||
tick++;
|
tick++;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user