Skip to main content
Module

x/easyts/time/mod.ts

js library written with ts, use select and chan like golang in js.
import * as easyts from "https://deno.land/x/easyts@0.1.0/time/mod.ts";

Classes

A Ticker containing a channel that will send the current 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 d must be greater than zero; if not, NewTicker will throw exception

Timer that will send the current time on its channel after at least duration millisecond.

Functions

waits for the duration to elapse and then sends the current time on the returned channel.

waits for the duration to elapse and then calls callback

Tick is a convenience wrapper for new Ticker providing access to the ticking channel only. While Tick is useful for clients that have no need to shut down the Ticker, be aware that without a way to shut it down the underlying Ticker cannot be recovered by the garbage collector; it "leaks". Unlike NewTicker

The callback is called whenever the duration elapses