Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Port countdown.coffee to PhantomJS 1.2

  • Loading branch information...
commit dd0d437b89e2eaffec4c42b526b0b73ce6c14560 1 parent 80131a2
IceArmy authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 examples/countdown.coffee
View
14 examples/countdown.coffee
@@ -1,8 +1,8 @@
t = 10
-while t > 0
- console.log t
- phantom.sleep 1000
- t = t - 1
-
-console.log 'BLAST OFF'
-phantom.exit()
+interval = setInterval ->
+ if t > 0
+ console.log t--
+ else
+ console.log 'BLAST OFF!'
+ phantom.exit()
+, 1000
Please sign in to comment.
Something went wrong with that request. Please try again.