From c54b33e92245fcffad9bebc4d1a956c84d6d928d Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Fri, 9 Aug 2024 15:01:56 -0400 Subject: [PATCH] format --- packages/core/neocyclist.mjs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/core/neocyclist.mjs b/packages/core/neocyclist.mjs index 70ac08f60..715c98dbb 100644 --- a/packages/core/neocyclist.mjs +++ b/packages/core/neocyclist.mjs @@ -46,23 +46,24 @@ export class NeoCyclist { this.worker_time_dif = time_dif; return; } - const secondsBetweenDiffChecks = 1.5; + const secondsBetweenDiffChecks = 1.5; // do nothing if interval has not passed yet - if (prevWorkerTimeDiffs.length >= sampleLength && Math.abs(time - timeAtPrevDiffSample) < secondsBetweenDiffChecks) { + if ( + prevWorkerTimeDiffs.length >= sampleLength && + Math.abs(time - timeAtPrevDiffSample) < secondsBetweenDiffChecks + ) { return; } - const rollingWorkerTimeDiff = averageArray(prevWorkerTimeDiffs); // how far the clock can drift before being corrected - const driftDelta = 0.002; + const driftDelta = 0.003; if (Math.abs(rollingWorkerTimeDiff - this.worker_time_dif) < driftDelta) { return; } - console.info(Math.abs(rollingWorkerTimeDiff - this.worker_time_dif)) - + timeAtPrevDiffSample = time; this.worker_time_dif = rollingWorkerTimeDiff; };