blob: f80b146c8fcc68a68d08004df87bca5b4e557738 (
plain) (
tree)
|
|
#!/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
*/
|