Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

set-harmonic-interval

1.0.1 • Public • Published

set-harmonic-interval

Works similar to setInterval, but calls all callbacks scheduled using setHarmonicInterval all at once, which have same delay in milliseconds.

Install

npm install set-harmonic-interval

Usage

In below example 1 and 2 will always be printed together every second.

const { setHarmonicInterval, clearHarmonicInterval } = require('set-harmonic-interval');
 
setHarmonicInterval(() => console.log(1), 1000);
setTimeout(() => {
  setHarmonicInterval(() => console.log(2), 1000);
}, 500);

License

Unlicense — public domain.

Keywords

none

Install

npm i set-harmonic-interval

DownloadsWeekly Downloads

210,541

Version

1.0.1

License

Unlicense

Unpacked Size

9.44 kB

Total Files

8

Last publish

Collaborators

  • avatar