From 013319d7a4651d1708280f556e39c2f03839426a Mon Sep 17 00:00:00 2001 From: Maks Jopek Date: Sun, 25 Apr 2021 12:07:36 +0200 Subject: Almost going in a circle --- helpers/helpers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'helpers/helpers.ts') 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 { + return new Promise(resolve => setTimeout(resolve, ms)); + } + static Color: Colors = { blue: 0, red: 1, -- cgit v1.3.1