Skip to content

Instantly share code, notes, and snippets.

@linux-china
Created May 25, 2020 17:56
Show Gist options
  • Save linux-china/3d8d829e8b461587e260b58feec3da24 to your computer and use it in GitHub Desktop.
Save linux-china/3d8d829e8b461587e260b58feec3da24 to your computer and use it in GitHub Desktop.
wait for TypeScript
function wait(ms: number):Promise<undefined> {
return new Promise(resolve => setTimeout(resolve, ms));
}
await wait(1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment