some more moving code around

This commit is contained in:
Zutatensuppe 2020-11-09 01:54:05 +01:00
parent d4ddf91259
commit 73872ebb6f
3 changed files with 564 additions and 535 deletions

21
game/Debug.js Normal file
View 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,
}