import { time } from "https://deno.land/x/async_channels@v1.0.0-rc5/mod.ts";
const { Ticker } = time;
A Ticker holds a channel that delivers “ticks” of a clock at intervals.
Constructors
constructs a new Ticker
containing a channel that will send the time on the channel
after each tick. The period of the ticks is specified by the duration
argument.
The ticker will adjust the time interval or drop ticks to make up for slow receivers.
The duration
must be greater than zero; if not, NewTicker will throw.
Stop the ticker to release associated resources.
Methods
reset
stops a ticker and resets its period to the specified duration.
The next tick will arrive after the new period elapses.
stop
turns off a ticker. After stop
, no more ticks will be sent.
stop
does not close the channel, to prevent a concurrent goroutine reading from the
channel from seeing an erroneous "tick".