Created
January 30, 2017 18:26
-
-
Save samueljoli/9a0bd54b8d207cc728f9fb19bacb91de to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var Async = require('async'); | |
| var numbers = []; | |
| function test(){ | |
| for(var i=1; i <= 1000000; i++) { | |
| numbers.push(i); | |
| } | |
| Async.map(numbers, function(num, callback) { | |
| setTimeout(function() { | |
| callback(Math.pow(num, 2)); | |
| }, 200); | |
| }, function(err, result) { | |
| console.log('done'); | |
| }) | |
| } | |
| test(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment