Skip to content

Instantly share code, notes, and snippets.

@zwetan
Created May 29, 2015 03:42
Show Gist options
  • Save zwetan/86ae3ed405f7fd788340 to your computer and use it in GitHub Desktop.
Save zwetan/86ae3ed405f7fd788340 to your computer and use it in GitHub Desktop.
a basic "forever loop"
#!/usr/bin/as3shebang --
import C.stdlib.*; // exit
import C.unistd.*; // sleep
var i:uint = 0;
function show():void
{
trace( "hello", i );
i++;
}
// main loop
while( true )
{
sleep( 5000 );
show();
if( i > 5 )
{
exit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment