From 431d4f556ef5fc1df623e8d9de9240d092e20372 Mon Sep 17 00:00:00 2001 From: Jan Scheiper Date: Mon, 16 May 2022 23:09:31 +0200 Subject: [PATCH] added asyncTimeout util --- utils.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils.js b/utils.js index 794594c..dc4ab64 100644 --- a/utils.js +++ b/utils.js @@ -67,9 +67,16 @@ function RGB_to_HSL(rgb) { }; } +function asyncTimeout(timeout) { + return new Promise(resolve => { + setTimeout(resolve, timeout); + }); +} + module.exports = { fillPartialHSL, clamp, HSL_to_RGB, RGB_to_HSL, + asyncTimeout, }; \ No newline at end of file