From 007022955613f92fc12fd9e94eb31829d6f3cfa8 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 28 Mar 2023 17:06:58 +0200 Subject: [PATCH 1/2] Revert "substituting first stored keypress duration start with test start (because stats are reset on test start)" This reverts commit 04ce710e9380450d189291d3151d498809b1df88. --- frontend/src/ts/test/test-input.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index da57d5721..60c82d09f 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -1,6 +1,5 @@ import * as TestWords from "./test-words"; import { roundTo2, stdDev, mean } from "../utils/misc"; -import * as TestStats from "./test-stats"; interface Keypress { count: number; @@ -241,12 +240,7 @@ let newKeypresDurationArray: number[] = []; export function recordKeyupTime(key: string): void { const now = performance.now(); - let diff = Math.abs(keysObj[key] - now); - - if (isNaN(diff) && newKeypresDurationArray.length === 0) { - diff = Math.abs(TestStats.start - now); - } - + const diff = Math.abs(keysObj[key] - now); newKeypresDurationArray.push(roundTo2(diff)); delete keysObj[key]; From 27949a90166d40f38adf39a829a9cc788306396b Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 28 Mar 2023 17:07:49 +0200 Subject: [PATCH 2/2] not needed --- frontend/src/ts/test/test-input.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 60c82d09f..a87b2b358 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -391,7 +391,6 @@ export function resetKeypressTimings(): void { newKeypresDurationArray = []; totalOverlap = 0; lastOverlapStartTime = -1; - keysObj = {}; if (spacingDebug) console.clear(); }