Skip to content

Commit 59db045

Browse files
committed
refactor(keepScanning): remove performance.now call
`requestAnimationFrame` handler already receives a timestamp as an argument. No need to call `performance.now`.
1 parent b5a2249 commit 59db045

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/misc/scanner.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ export function keepScanning (camera, options) {
3434
let locationBefore = null
3535
let lastScanned = performance.now()
3636

37-
const processFrame = () => {
37+
const processFrame = timeNow => {
3838
if (shouldContinue()) {
3939
window.requestAnimationFrame(processFrame)
4040

41-
const timeNow = performance.now()
42-
4341
if (timeNow - lastScanned >= minDelay) {
4442
lastScanned = timeNow
4543

0 commit comments

Comments
 (0)