-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refactor fast timers, fix UND_ERR_CONNECT_TIMEOUT on event loop …
…blocking (#3495) * fix: refactor fast timers, fix UND_ERR_CONNECT_TIMEOUT on event loop blocking * also test native timers * improve the commentary of fasttimers * revert changes in client-h1.js * make fasttimers independent from performance.now * less flaky?
- Loading branch information
Showing
10 changed files
with
714 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { bench, group, run } from 'mitata' | ||
|
||
group('timers', () => { | ||
bench('Date.now()', () => { | ||
Date.now() | ||
}) | ||
bench('performance.now()', () => { | ||
performance.now() | ||
}) | ||
bench('Math.trunc(performance.now())', () => { | ||
Math.trunc(performance.now()) | ||
}) | ||
bench('process.uptime()', () => { | ||
process.uptime() | ||
}) | ||
}) | ||
|
||
await run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.