aboutsummaryrefslogtreecommitdiffstats
path: root/helpers
diff options
context:
space:
mode:
authorMaks Jopek <maksymilian.jopek@prym-soft.pl>2021-04-25 12:07:36 +0200
committerMaks Jopek <maksymilian.jopek@prym-soft.pl>2021-04-25 12:07:36 +0200
commit013319d7a4651d1708280f556e39c2f03839426a (patch)
tree704e51c6d4d96360611819628be3c78edec2f9d8 /helpers
parent13dcc2c8fc1d11e3b94432fffc4c4f186bd94d29 (diff)
downloadfia-013319d7a4651d1708280f556e39c2f03839426a.tar.gz
fia-013319d7a4651d1708280f556e39c2f03839426a.tar.zst
fia-013319d7a4651d1708280f556e39c2f03839426a.zip
Almost going in a circle
Diffstat (limited to 'helpers')
-rw-r--r--helpers/helpers.ts7
-rw-r--r--helpers/helpersBack.ts2
2 files changed, 6 insertions, 3 deletions
diff --git a/helpers/helpers.ts b/helpers/helpers.ts
index 80fb5ab..3800040 100644
--- a/helpers/helpers.ts
+++ b/helpers/helpers.ts
@@ -66,15 +66,18 @@ export default class Helpers {
return res;
else
throw new Error("API Error!");;
-
}
- static getRandomInt(min: number, max: number) {
+ static getRandomInt(min: number, max: number): number {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
}
+ static async sleep(ms: number): Promise<void> {
+ return new Promise(resolve => setTimeout(resolve, ms));
+ }
+
static Color: Colors = {
blue: 0,
red: 1,
diff --git a/helpers/helpersBack.ts b/helpers/helpersBack.ts
index 5aaae77..6a3dfd7 100644
--- a/helpers/helpersBack.ts
+++ b/helpers/helpersBack.ts
@@ -72,7 +72,7 @@ export async function sleep(ms: number) {
}
export async function waitForQueue(): Promise<void> {
while(global.stop === true) {
- await sleep(200);
+ await sleep(50);
}
}