Skip to content

Instantly share code, notes, and snippets.

Created March 27, 2014 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2b09f37fb4c24dde1b2c to your computer and use it in GitHub Desktop.
Save anonymous/2b09f37fb4c24dde1b2c to your computer and use it in GitHub Desktop.
Kablooie closure and delaysec keyword
img label = img.Label;
float waitSeconds = 4;
delaysec(waitSeconds)
{
label.SetTextWithKnownChars("Done waiting now.");
delaysec(waitSeconds)
{
// Execution of this line is delayed by (2 * waitSeconds).
label.SetTextWithKnownChars("Ha, just kidding, actually waited some more.");
}
}
// Execution continues here without stopping, so this is the first message shown.
label.SetTextWithKnownChars("Please wait...");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment