mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-20 20:46:15 +08:00
added promise based sleep function
This commit is contained in:
parent
32550a54e3
commit
5cb2a65d11
1 changed files with 4 additions and 0 deletions
|
|
@ -1209,3 +1209,7 @@ export function abbreviateNumber(num: number): string {
|
|||
const pre = "kmbtqQsSond".charAt(exp - 1);
|
||||
return (num / Math.pow(1000, exp)).toFixed(1) + pre;
|
||||
}
|
||||
|
||||
export function sleep(ms: number): Promise<void> {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue