aboutsummaryrefslogtreecommitdiffstats
path: root/helpers/helpers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/helpers.ts')
-rw-r--r--helpers/helpers.ts7
1 files changed, 5 insertions, 2 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,