maketimer

1.0.3 • Public • Published

Installation: npm install maketimer --save

MakeTimer.js

example usage:

// Example usage
var MakeTimer = require("./MakeTimer");

var timed = new MakeTimer();
var looper = new MakeTimer();
var count = 10;
var looping = 10;

function thing(){
  if(count >= 0){
    timed.start(1000,aTimedThing,thing);
  }
  if(count === 5){
    timed.stop();
  }
}

function loops() {
  looper.loop(3000, function () {
    --looping;
    console.log("this is a loopy counter", looping);
    if (looping < 5) {
      looper.halt();
    }
  });
}

function aTimedThing() {
  console.log("this is timed count", count);
  count--;
}

thing();
loops();

Readme

Keywords

Package Sidebar

Install

npm i maketimer

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

1.99 kB

Total Files

3

Last publish

Collaborators

  • pahosler