Josue, take a look at java Timers
There is also many ways to do that with clojure: using future, agents, or core.async.
Put this into the clojure.core will bring an unnecessary complexity and cost of maintenance.
There is also some design choices, like, it will run on a thread pool? it will wait the task to terminate to start to count the timeout? it can be blocking?
So feel free to create your our
josue.timer API or using some already existing
Here a code using java timers:
(let [every-5-sec (java.time.Duration/parse "PT5S")
ok-task (proxy [java.util.TimerTask] 
;; save this return for later
timer-task (doto (java.util.Timer.)