Last active
July 24, 2017 16:16
-
-
Save Cryolite/d7a27ec349fce83c2245ab8bb1e4ad0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
observer = startObservingAsynchronousEvent(timeout=one_minute); | |
while (true) { | |
if (observer.eventOccurs()) break; | |
if (observer.eventOccursOrTimeout()) { | |
// if (observer.eventOccurs()) break; | |
throw TimeoutException(); | |
} | |
sleep(one_second); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment