Library for working with time.
Get the Time at the moment when this task is run.
Subscribe to the current time. First you provide an interval describing how
frequently you want updates. Second, you give a tagger that turns a time into a
message for your update function. So if you want to hear about the current
time every second, you would say something like this:
type Msg = Tick Time | ...
subscriptions model =
every second TickCheck out the Elm Architecture Tutorial for more info on how subscriptions work.
Note: this function is not for animation! You need to use something based
on requestAnimationFrame to get smooth animations. This is based on
setInterval which is better for recurring tasks like “check on something
every 30 seconds”.
Units of time, making it easier to specify things like a half-second
(500 * millisecond) without remembering Elm’s underlying units of time.
Type alias to make it clearer when you are working with time values. Using the
Timehelpers likesecondandinSecondsinstead of raw numbers is very highly recommended.