Library for working with time.
Units of time, making it easier to specify things like a half-second
(500 * milliseconds) without remembering Elm’s underlying units of time.
Takes desired number of frames per second (fps). The resulting signal gives a sequence of time deltas as quickly as possible until it reaches the desired FPS. A time delta is the time between the last frame and the current frame.
Same as the fps function, but you can turn it on and off. Allows you to do brief animations based on user input without major inefficiencies. The first time delta after a pause is always zero, no matter how long the pause was. This way summing the deltas will actually give the amount of time that the output signal has been running.
Takes a time interval t. The resulting signal is the current time, updated every t.
Add a timestamp to any signal. Timestamps increase monotonically. When you
create (timestamp Mouse.x), an initial timestamp is produced. The timestamp
updates whenever Mouse.x updates.
Timestamp updates are tied to individual events, so
(timestamp Mouse.x) and (timestamp Mouse.y) will always have the same
timestamp because they rely on the same underlying event (Mouse.position).
Delay a signal by a certain amount of time. So (delay second Mouse.clicks)
will update one second later than any mouse click.
Takes a time t and any signal. The resulting boolean signal is true for
time t after every event on the input signal. So (second `since`
Mouse.clicks) would result in a signal that is true for one second after
each mouse click and false otherwise.
Type alias to make it clearer when you are working with time values. Using the
Timeconstants instead of raw numbers is very highly recommended.