some more moving code around
This commit is contained in:
parent
d4ddf91259
commit
73872ebb6f
3 changed files with 564 additions and 535 deletions
21
game/Debug.js
Normal file
21
game/Debug.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
let _pt = 0
|
||||
let _mindiff = 0
|
||||
|
||||
const checkpoint_start = (mindiff) => {
|
||||
_pt = performance.now()
|
||||
_mindiff = mindiff
|
||||
}
|
||||
|
||||
const checkpoint = (label) => {
|
||||
const now = performance.now();
|
||||
const diff = now - _pt
|
||||
if (diff > _mindiff) {
|
||||
console.log(label + ': ' + (diff));
|
||||
}
|
||||
_pt = now;
|
||||
}
|
||||
|
||||
export default {
|
||||
checkpoint_start,
|
||||
checkpoint,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue