You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
480 B
JavaScript

"use strict";
const Promise = require("bluebird");
const promiseDelaySince = require("./");
let startTimestamp = Date.now();
Promise.try(() => {
// Logs immediately after running
console.log("Hello world 1");
return promiseDelaySince(startTimestamp, 2000);
}).then(() => {
// Logs 2 seconds after running
console.log("Hello world 2");
return promiseDelaySince(startTimestamp, 3000);
}).then(() => {
// Logs 3 seconds after running
console.log("Hello world 3");
});