Skip to content

Commit 3cfcc9b

Browse files
committed
fix: bind timestamping method to their modules once
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
1 parent 3292e57 commit 3cfcc9b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/time.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ export const now = (() => {
2828

2929
return () => {
3030
const now = performance.now.bind(performance)
31-
return 1e6 * now()
31+
return () => 1e6 * now()
3232
}
3333
},
34-
node: () => () => {
35-
const hrtimeNow = process.hrtime.bigint.bind(process)
36-
return Number(hrtimeNow())
34+
node: () => {
35+
const hrtimeBigint = process.hrtime.bigint.bind(process.bigint)
36+
return () => Number(hrtimeBigint())
3737
},
38-
deno: () => () => {
38+
deno: () => {
3939
const now = performance.now.bind(performance)
40-
return 1e6 * now()
40+
return () => 1e6 * now()
4141
},
4242
bun: () => {
4343
const now = Bun.nanoseconds.bind(Bun)

0 commit comments

Comments
 (0)