Skip to content

Commit 3bdc41d

Browse files
authored
perf: improve the performance of getNow (#5944)
1 parent 0cd21ba commit 3bdc41d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runtime-dom/src/modules/events.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
2525
// if the low-res timestamp which is bigger than the event timestamp
2626
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
2727
// and we need to use the hi-res version for event listeners as well.
28-
_getNow = () => performance.now()
28+
_getNow = performance.now.bind(performance)
2929
}
3030
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
3131
// and does not fire microtasks in between event propagation, so safe to exclude.

0 commit comments

Comments
 (0)