Skip to content

Commit

Permalink
Add once-per-second example to README (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
samhedin authored May 3, 2024
1 parent 99ae29d commit 9f2f87e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ To generate the sequence of times, you'll need to seed the call to `periodic-seq
(Period/ofDays 1))
----

For example, to say hello once per second:
[source,clojure]
----
(chime/chime-at (chime/periodic-seq (Instant/now) (Duration/ofSeconds 1))
;; note that the function needs to take an argument.
(fn [time]
(println "hello")))
----

=== Complex schedules

Because there is no scheduling DSL included with Chime, the sorts of schedules that you can achieve are not limited to the scope of the DSL.
Expand Down

0 comments on commit 9f2f87e

Please sign in to comment.