Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Testing Iced CoffeeScript
#!/usr/bin/env iced
# only Iced CoffeeScript (http://maxtaco.github.com/coffee-script/) will be able
# to run this, as await and defer are not yet included in
#mainstream CoffeeScript, at least, as of 2012-04-27
acum = 0
interval = parseInt(process.argv[2]) or 1000
console.log "Starting counter"
for n in [1..5]
await setTimeout(defer(), interval)
acum += interval
console.log "Elapsed #{acum} milliseconds"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment