Files
api/app/core/utils/misc/sleep.ts
Alexis Tyler 855ba2fc75 chore: lint
2021-01-29 12:03:26 +10:30

17 lines
340 B
TypeScript

/*!
* Copyright 2019-2020 Lime Technology Inc. All rights reserved.
* Written by: Alexis Tyler
*/
/**
* Sleep for a certain amount of milliseconds.
* @param ms How many milliseconds to sleep for.
*/
export const sleep = async (ms: number) => {
return new Promise<void>(resolve => {
setTimeout(() => {
resolve();
}, ms);
});
};