We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4328ac commit 78cf47bCopy full SHA for 78cf47b
README.md
@@ -49,6 +49,8 @@ Step 2. Add the dependency
49
50
<summary>展开查看</summary>
51
52
+https://leetcode.cn/problems/sleep
53
+
54
https://leetcode.cn/problems/array-prototype-last
55
56
https://leetcode.cn/problems/counter
sleep/index.ts
@@ -0,0 +1,8 @@
1
+export default async function sleep(millis: number): Promise<void> {
2
+ await new Promise((s) => setTimeout(s, millis));
3
+}
4
5
+/**
6
+ * let t = Date.now()
7
+ * sleep(100).then(() => console.log(Date.now() - t)) // 100
8
+ */
0 commit comments