Created
December 27, 2014 01:44
-
-
Save masudak/fa43d9d808ca0fc8471c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var async = require('async'); | |
function sleep(time, callback){ | |
setTimeout(callback, time); | |
} | |
async.series([ | |
function(callback) { | |
console.log('###1'); | |
sleep(1000, function (){ console.log("1 done"); } ) | |
callback(null, 1); | |
}, | |
function(callback) { | |
console.log('###3'); | |
sleep(3000, function (){ console.log("3 done"); } ) | |
callback(null, 1); | |
}, | |
function(callback) { | |
console.log('###2'); | |
sleep(2000, function (){ console.log("2 done"); } ) | |
callback(null, 1); | |
}, | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
結果: