Last active
August 29, 2015 14:01
-
-
Save alexispurslane/c97935d73c3f8f6928cd to your computer and use it in GitHub Desktop.
A setTimeout type function for Racket. It uses seconds, has a function to call while waiting for the callback.
This file contains hidden or 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
| (define (wait time callback [t (current-seconds)] [while-wait (lambda () null)]) | |
| (cond | |
| [(<= (+ time t) (current-seconds)) (callback)] | |
| [else | |
| (while-wait) | |
| (wait time callback t)])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment