Improve movement

This commit is contained in:
schmelczerandras 2020-10-07 21:05:24 +02:00
parent e01400058d
commit 9e35538b79
13 changed files with 164 additions and 125 deletions

View file

@ -9,4 +9,12 @@ export class DeltaTimeCalculator {
return seconds * 1000 + nanoSeconds / 1000 / 1000;
}
public getDeltaTimeInMilliseconds(): number {
const deltaTime = process.hrtime(this.previousTime);
const [seconds, nanoSeconds] = deltaTime;
return seconds * 1000 + nanoSeconds / 1000 / 1000;
}
}