1.0.3 • Published 6 years ago

maketimer v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

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();
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago