mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-01 09:14:27 +08:00
Merge branch 'master' into newads
This commit is contained in:
commit
13afd3da00
1 changed files with 1 additions and 8 deletions
|
@ -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];
|
||||
|
||||
|
@ -397,7 +391,6 @@ export function resetKeypressTimings(): void {
|
|||
newKeypresDurationArray = [];
|
||||
totalOverlap = 0;
|
||||
lastOverlapStartTime = -1;
|
||||
keysObj = {};
|
||||
if (spacingDebug) console.clear();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue