mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 08:43:48 +03:00
correctly print time logs
This commit is contained in:
parent
efab6a7c30
commit
cb82424eb2
@ -15,7 +15,7 @@ export const startProcessWatcher = async () => {
|
|||||||
while (true) {
|
while (true) {
|
||||||
await sleep(sleepTime);
|
await sleep(sleepTime);
|
||||||
|
|
||||||
console.log("loopTotalTime");
|
console.time("loopTotalTime");
|
||||||
const games = await gameRepository.find({
|
const games = await gameRepository.find({
|
||||||
where: {
|
where: {
|
||||||
executablePath: Not(IsNull()),
|
executablePath: Not(IsNull()),
|
||||||
@ -66,16 +66,13 @@ export const startProcessWatcher = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gamesPlaytime.set(game.id, performance.now());
|
gamesPlaytime.set(game.id, performance.now());
|
||||||
|
} else if (gamesPlaytime.has(game.id)) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamesPlaytime.has(game.id)) {
|
|
||||||
gamesPlaytime.delete(game.id);
|
gamesPlaytime.delete(game.id);
|
||||||
if (WindowManager.mainWindow) {
|
if (WindowManager.mainWindow) {
|
||||||
WindowManager.mainWindow.webContents.send("on-game-close", game.id);
|
WindowManager.mainWindow.webContents.send("on-game-close", game.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.timeEnd("loopTotalTime");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user