Skip to content

Records the time interval between consecutive values emitted from a stream.

License

Notifications You must be signed in to change notification settings

ThomWright/flyd-timeInterval

Repository files navigation

flyd-timeInterval

Travis npm David David

Records the time interval between consecutive values emitted from a stream.

Signature

Stream -> Stream

Usage

import every from 'flyd-every';
import timeInterval from 'flyd-timeinterval';

const stream = every(INTERVAL),
      intervalStream = timeInterval(stream);

flyd.stream([intervalStream, stream], () => {
  console.log('Interval:', intervalStream().interval, ', Time:', intervalStream().time);
});

// Interval: 0 , Time: 1434814906566
// Interval: 200 , Time: 1434814906767
// Interval: 200 , Time: 1434814906967
// Interval: 200 , Time: 1434814907167
// Interval: 199 , Time: 1434814907366

About

Records the time interval between consecutive values emitted from a stream.

Resources

License

Stars

Watchers

Forks

Packages

No packages published