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 32ac4a4 commit a2f012cCopy full SHA for a2f012c
solution/2600-2699/2621.Sleep/README_EN.md
@@ -69,6 +69,26 @@ async function sleep(millis: number): Promise<void> {
69
70
<!-- tabs:end -->
71
72
+
73
+<!-- tabs:start -->
74
75
+#### JavaScript
76
+```js
77
+/**
78
+ * @param {number} millis
79
+ * @return {Promise}
80
+ */
81
+async function sleep(millis) {
82
+ return new Promise ( r => setTimeout(r,millis))
83
+}
84
85
86
+ * let t = Date.now()
87
+ * sleep(100).then(() => console.log(Date.now() - t)) // 100
88
89
90
+<!-- tabs:end -->
91
92
<!-- solution:end -->
93
94
<!-- problem:end -->
0 commit comments