diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-01-06 04:23:15 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-01-06 04:23:15 +0000 |
commit | 810f40a03a112d10b42137636d1871e867b1f2ee (patch) | |
tree | a90aa2e360ab9f8525e9598d2b04a6d80a70faff | |
parent | 2723 (diff) | |
download | leetcode-810f40a03a112d10b42137636d1871e867b1f2ee.tar.gz leetcode-810f40a03a112d10b42137636d1871e867b1f2ee.zip |
26121
Diffstat (limited to '')
-rw-r--r-- | 2621/main.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/2621/main.js b/2621/main.js new file mode 100644 index 0000000..f80b146 --- /dev/null +++ b/2621/main.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node +"use strict"; + +/** + * @param {number} millis + * @return {Promise} + */ +async function sleep(millis) { + await new Promise((resolve) => setTimeout(resolve, millis)); +} + +/** + * let t = Date.now() + * sleep(100).then(() => console.log(Date.now() - t)) // 100 + */ |