0.1.2 • Published 7 years ago

stopwatch-stream v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

stopwatch-stream

A streaming human readable stopwatch.

Build Status

Exposes an RxJS Observable

Default Format

00:00:00

Usage;

const stopWatch = require('stopwatch-stream');
const sw = stopWatch();

Basic

sw.stream.subscribe((s) => {
	console.log(s); //00:00:00 ...
});
sw.start();

Pausing

sw.stream.subscribe((s) => {
	console.log(s);
});

sw.start();

sw.stop();

Current

sw.current(); // 00:00:00

Cleanup

sw.stream.subscribe((s) => {
	console.log(s);
});

sw.start();

sw.stop();

sw.complete();

Options

Stream on init

const sw = stopWatch({
	on: true
});

sw.stream.subscribe((s) => {
	console.log(s);
});

Stopwatch format

 const sw = stopWatch({
    format: '000',
    delimiter: '.'
  });
 sw.current(); // '00:00.000'
0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago