Ported 'countdown.js' to PhantomJS 1.2

1.2
Ivan De Marino 2011-06-01 14:25:22 +01:00
parent b91f5b9632
commit 811c56b6f3
1 changed files with 9 additions and 8 deletions

View File

@ -1,8 +1,9 @@
var t = 10;
while (t > 0) {
console.log(t);
phantom.sleep(1000);
t = t - 1;
}
console.log('BLAST OFF');
phantom.exit();
var t = 10,
interval = setInterval(function(){
if ( t > 0 ) {
console.log(t--);
} else {
console.log("BLAST OFF!");
phantom.exit();
}
}, 1000);