Skip to content

Commit

Permalink
sleep method added
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzitelli committed Mar 15, 2023
1 parent b596731 commit f5bdace
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ export const randomNum = (min: number = 1, max: number = 99) => {
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min); // The maximum is exclusive and the minimum is inclusive
};

export const sleep = (ms: number) => new Promise(resolver => setTimeout(resolver, ms));

0 comments on commit f5bdace

Please sign in to comment.