X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerUtils.ts;h=7c72ff3e57fcac90ed51150f7780727a754df808;hb=aaf2bf9c2ec7712394d7ab9da12449262d894e60;hp=4d6868f76f35cf77166cfcff54c7e23ccae0036d;hpb=0f187001df8a7a1ecf7f54b67e9a24bd95c6b444;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerUtils.ts b/src/worker/WorkerUtils.ts index 4d6868f7..7c72ff3e 100644 --- a/src/worker/WorkerUtils.ts +++ b/src/worker/WorkerUtils.ts @@ -5,9 +5,13 @@ 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 stopped with exit code ${code}`)); + console.error(chalk.red(`Worker exited with error exit code: ${code.toString()}`)); } };