diff --git a/back/src/Services/CpuTracker.ts b/back/src/Services/CpuTracker.ts index 69eac8b9..abc0a17b 100644 --- a/back/src/Services/CpuTracker.ts +++ b/back/src/Services/CpuTracker.ts @@ -13,13 +13,13 @@ class CpuTracker { let time = process.hrtime.bigint() let usage = process.cpuUsage() setInterval(() => { - let elapTime = process.hrtime.bigint(); - let elapUsage = process.cpuUsage(usage) + const elapTime = process.hrtime.bigint(); + const elapUsage = process.cpuUsage(usage) usage = process.cpuUsage() - let elapTimeMS = elapTime - time; - let elapUserMS = secNSec2ms(elapUsage.user) - let elapSystMS = secNSec2ms(elapUsage.system) + const elapTimeMS = elapTime - time; + const elapUserMS = secNSec2ms(elapUsage.user) + const elapSystMS = secNSec2ms(elapUsage.system) this.cpuPercent = Math.round(100 * (elapUserMS + elapSystMS) / Number(elapTimeMS) * 1000000) time = elapTime; @@ -27,7 +27,7 @@ class CpuTracker { console.log('elapsed user ms: ', elapUserMS) console.log('elapsed system ms:', elapSystMS) console.log('cpu percent: ', this.cpuPercent)*/ - }, 500); + }, 100); } public getCpuPercent(): number { diff --git a/front/src/Enum/EnvironmentVariable.ts b/front/src/Enum/EnvironmentVariable.ts index 59c8b50f..0479d252 100644 --- a/front/src/Enum/EnvironmentVariable.ts +++ b/front/src/Enum/EnvironmentVariable.ts @@ -7,7 +7,7 @@ const JITSI_URL : string|undefined = (process.env.JITSI_URL === '') ? undefined const RESOLUTION = 3; const ZOOM_LEVEL = 1/*3/4*/; const POSITION_DELAY = 200; // Wait 200ms between sending position events -const MAX_EXTRAPOLATION_TIME = 250; // Extrapolate a maximum of 250ms if no new movement is sent by the player +const MAX_EXTRAPOLATION_TIME = 100; // Extrapolate a maximum of 250ms if no new movement is sent by the player export { DEBUG_MODE,