(drift: number)
| 326 | } |
| 327 | |
| 328 | function checkIfTimerIsSlow(drift: number): void { |
| 329 | if (!slowTimerFailEnabled) return; |
| 330 | if ( |
| 331 | (Config.mode === "time" && Config.time < 130 && Config.time > 0) || |
| 332 | (Config.mode === "words" && Config.words < 250 && Config.words > 0) |
| 333 | ) { |
| 334 | if (drift > 125) { |
| 335 | //slow timer |
| 336 | SlowTimer.set(); |
| 337 | setLowFpsMode(); |
| 338 | } |
| 339 | if (drift > 250) { |
| 340 | slowTimerCount++; |
| 341 | } |
| 342 | |
| 343 | if (drift > 500 || slowTimerCount > 5) { |
| 344 | //slow timer |
| 345 | |
| 346 | showNoticeNotification( |
| 347 | 'This could be caused by "efficiency mode" on Microsoft Edge.', |
| 348 | ); |
| 349 | |
| 350 | slowTimerNotifIds.push( |
| 351 | showErrorNotification( |
| 352 | "Stopping the test due to bad performance. This would cause test calculations to be incorrect. If this happens a lot, please report this.", |
| 353 | ), |
| 354 | ); |
| 355 | |
| 356 | timerEvent.dispatch({ key: "fail", value: "slow timer" }); |
| 357 | } |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | export async function start(now: number): Promise<void> { |
| 362 | SlowTimer.clear(); |
no test coverage detected