X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerUtils.ts;h=7c72ff3e57fcac90ed51150f7780727a754df808;hb=aa49f5ec9d64b41b50509b41abde34aa0affe8c1;hp=2b6123514633799c668060ff755e4d7a645394a7;hpb=d3d85b21c808392ead67dd1bba5a7ddc34e2ae0a;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerUtils.ts b/src/worker/WorkerUtils.ts index 2b612351..7c72ff3e 100644 --- a/src/worker/WorkerUtils.ts +++ b/src/worker/WorkerUtils.ts @@ -5,6 +5,10 @@ export class WorkerUtils { // This is intentional } + public static async sleep(milliSeconds: number): Promise { + return new Promise((resolve) => setTimeout(resolve as () => void, milliSeconds)); + } + public static defaultExitHandler = (code: number): void => { if (code !== 0) { console.error(chalk.red(`Worker exited with error exit code: ${code.toString()}`));