aboutsummaryrefslogblamecommitdiffstats
path: root/2621/main.js
blob: f80b146c8fcc68a68d08004df87bca5b4e557738 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
 */