clock-scheduler

0.1.1 • Public • Published

clock-scheduler

Build Status Coverage Status WebReflection status

Same as setTimeout and setInterval but pinned to the clock.

import Clock from 'clock-scheduler';
const Clock = require('clock-scheduler');
// https://unpkg.com/clock-scheduler
 
// will log next date whenever the next minute will tick
const uid = Clock.setTimeout(
  // a callback to invoke at next clock tick
  random => console.log(random, new Date),
 
  // second(s), minute(s), hour(s), day(s), month(s), year(s)
  'minute',
 
  // any extra argument allowed, just like setInterval/Timeout
  Math.random()
);
// Clock.clearInterval(uid);

Package Sidebar

Install

npm i clock-scheduler

Weekly Downloads

56

Version

0.1.1

License

ISC

Unpacked Size

9.88 kB

Total Files

8

Last publish

Collaborators

  • webreflection