radare2/sys/build/stress.js
2016-09-27 18:44:34 +02:00

36 lines
748 B
JavaScript

switch (2) {
case 0:
var U = require ("./make.js/utils.js");
U.iterate ([1,2,3,4], function(x, next, done) {
setTimeout (function() {
console.log ("---");
next ();
},500);
}, function(x) {
console.log ("done: "+x);
});
break;
case 1:
var U = require ("./make.js/utils.js");
U.iterate ([1,2,3,4], function(x, next, done) {
setTimeout (function() {
console.log (arguments);
done ();
},1000);
next();
}, function(x) {
console.log ("done: "+x);
});
break;
case 2:
var U = require ("./make.js/utils.js");
U.iterate ([1,2,3,4], function(x, next, done) {
setTimeout (function() {
console.log ("NOW RUN "+x+ "--- ");
next();
}, 1000*Math.random()%10000);
}, function(x) {
console.log ("done: "+x);
});
}