File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,34 +30,34 @@ Quick tutorial
3030You can simply start a period task with every 5 seconds immediately like this:
3131
3232``` clojure
33- (use 'ruiyun.tools.timer)
34- (run-task! #(println " Say hello every 5 seconds." ) :period 5000 )
33+ (use 'ruiyun.tools.timer)
34+ (run-task! #(println " Say hello every 5 seconds." ) :period 5000 )
3535```
3636
3737If you want delay the first run with 2 seconds:
3838
3939``` clojure
40- (run-task! #(println \"Say hello after 2 seconds.\") :dealy 2000 )
40+ (run-task! #(println \"Say hello after 2 seconds.\") :dealy 2000 )
4141```
4242
4343Use this if you want to execute a task at an absolute time:
4444
4545``` clojure
46- (run-task! #(println " Say hello at 2013-01-01T00:00:00 in beijing." ) :at #inst " 2013-01-01T00:00:00+08:00" )
46+ (run-task! #(println " Say hello at 2013-01-01T00:00:00 in beijing." ) :at #inst " 2013-01-01T00:00:00+08:00" )
4747```
4848
4949And, you can use the same timer in more than one tasks:
5050
5151``` clojure
52- (def greeting-timer (timer \"The timer for greeting\"))
53- (run-task! #(println \"Say hello after 2 seconds.\") :dealy 2000 :by greeting-timer)
54- (run-task! #(println \"Say hello every 5 seconds.\") :period 5000 :by greeting-timer)
52+ (def greeting-timer (timer \"The timer for greeting\"))
53+ (run-task! #(println \"Say hello after 2 seconds.\") :dealy 2000 :by greeting-timer)
54+ (run-task! #(println \"Say hello every 5 seconds.\") :period 5000 :by greeting-timer)
5555```
5656
5757Finally, you can cancel a timer's tasks:
5858
5959``` clojure
60- (cancel! greeting-timer)
60+ (cancel! greeting-timer)
6161```
6262
6363Documentation
You can’t perform that action at this time.
0 commit comments