2019-03-21 19:02:05 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delay in an async/await function
|
|
|
|
*
|
|
|
|
* @param {integer} ms Milliseconds to delay for
|
|
|
|
*
|
|
|
|
* @returns {Promise} Promise to resolve after timeout
|
|
|
|
**/
|
|
|
|
|
|
|
|
function delay (ms : number) {
|
|
|
|
return new Promise((resolve : any) => {
|
|
|
|
return setTimeout(resolve, ms);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-06-09 01:43:14 +00:00
|
|
|
module.exports.delay = delay;
|