UNPKG

@ceramicnetwork/core

Version:

Typescript implementation of the Ceramic protocol

16 lines 440 B
export class ClockSource { now() { return new Date(); } async waitUntil(until) { const delay = async function (ms) { return new Promise((resolve) => setTimeout(() => resolve(), ms)); }; let now = this.now(); while (now < until) { await delay(until.getTime() - now.getTime()); now = this.now(); } } } //# sourceMappingURL=clock-source.js.map