From ae8a59cf9b72475595d2a59b9c35cb8cf84f834c Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Wed, 19 Sep 2018 19:47:38 -0500 Subject: [PATCH] timer utility --- lib/utils/utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/utils/utils.js b/lib/utils/utils.js index 293c06b5..1eacdc2a 100644 --- a/lib/utils/utils.js +++ b/lib/utils/utils.js @@ -490,6 +490,10 @@ function errorMessage(e) { return e; } +async function timer(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + module.exports = { joinPath, dirname, @@ -532,5 +536,6 @@ module.exports = { sample, last, interceptLogs, - errorMessage + errorMessage, + timer };