Skip to content

Commit

Permalink
Time how long measure takes
Browse files Browse the repository at this point in the history
  • Loading branch information
curiousdannii committed Oct 24, 2024
1 parent c9f9e13 commit 0757665
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/glkote/web/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ export default class Metrics {
return
}
const oldmetrics = Object.assign({}, this.metrics)
let before = Date.now()

Check failure on line 177 in src/glkote/web/metrics.ts

View workflow job for this annotation

GitHub Actions / test (Node v20)

'before' is never reassigned. Use 'const' instead

Check failure on line 177 in src/glkote/web/metrics.ts

View workflow job for this annotation

GitHub Actions / test (Node v22)

'before' is never reassigned. Use 'const' instead
await this.measure()
let after = Date.now()

Check failure on line 179 in src/glkote/web/metrics.ts

View workflow job for this annotation

GitHub Actions / test (Node v20)

'after' is never reassigned. Use 'const' instead

Check failure on line 179 in src/glkote/web/metrics.ts

View workflow job for this annotation

GitHub Actions / test (Node v22)

'after' is never reassigned. Use 'const' instead
alert(`measure() took ${after - before}ms`)
if (metrics_differ(this.metrics, oldmetrics)) {
this.glkote.send_event({type: 'arrange'})
}
Expand Down

0 comments on commit 0757665

Please sign in to comment.