mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 18:15:41 +00:00
Implement sleep function
This commit is contained in:
11
src/util/util/extensions/Global.ts
Normal file
11
src/util/util/extensions/Global.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
declare global {
|
||||
function sleep(ms: number): Promise<void>;
|
||||
}
|
||||
|
||||
if (!globalThis.sleep) {
|
||||
globalThis.sleep = function (ms: number): Promise<void> {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
};
|
||||
}
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user