Skip to content

Instantly share code, notes, and snippets.

@beppu
Created October 6, 2014 21:09
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 beppu/1e071bfbba09eac20de8 to your computer and use it in GitHub Desktop.
Save beppu/1e071bfbba09eac20de8 to your computer and use it in GitHub Desktop.
Something like Javascript's setInterval function for Racket (using threads).
#lang racket
(define (set-interval interval fn)
(thread
(lambda ()
(let loop ()
(fn)
(sleep interval)
(loop)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment