help?> ?Base.Timer Timer(delay; interval = 0) Create a timer that wakes up tasks waiting for it (by calling wait on the timer object). Waiting tasks are woken after an initial delay of at least delay seconds, and then repeating after at least interval seconds again elapse. If interval is equal to 0, the timer is only triggered once. When the timer is closed (by close) waiting tasks are woken with an error. Use isopen to check whether a timer is still active.
# Here the first number is printed after a delay of two seconds, then the following # numbers are printed quickly. julia> begin i = 0 cb(timer) = (global i += 1; println(i)) t = Timer(cb, 2, interval=0.2) wait(t) sleep(0.5) close(t) end 1 2 3