diff options
author | Ajay <[email protected]> | 2022-02-08 16:04:23 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2022-02-08 16:04:23 -0500 |
commit | bb490bf7ad4bedd904109437e2e184826b3cb5b6 (patch) | |
tree | 010f3a65d598db29115f67d1d16bf6cea9cab1c9 | |
parent | 4cc248eb17ef5b2da3c46a8edb0a3d53d0c0c9c0 (diff) | |
download | SponsorBlock-bb490bf7ad4bedd904109437e2e184826b3cb5b6.tar.gz SponsorBlock-bb490bf7ad4bedd904109437e2e184826b3cb5b6.zip |
perfomance instead of date
-rw-r--r-- | src/content.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/content.ts b/src/content.ts index 3ecdfb3a..e8c7f0fb 100644 --- a/src/content.ts +++ b/src/content.ts @@ -533,10 +533,10 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?: const delayTime = timeUntilSponsor * 1000 * (1 / video.playbackRate); if (delayTime < 300 && utils.isFirefox()) { // For Firefox, use interval instead of timeout near the end to combat imprecise video time - const startIntervalTime = Date.now(); + const startIntervalTime = performance.now(); const startVideoTime = video.currentTime; currentSkipInterval = setInterval(() => { - const intervalDuration = Date.now() - startIntervalTime; + const intervalDuration = performance.now() - startIntervalTime; console.log(startVideoTime + intervalDuration / 1000) if (intervalDuration >= delayTime) { clearInterval(currentSkipInterval); |