Skip to content

Files

Latest commit

c46a879 · Oct 26, 2017

History

History
This branch is 11 commits ahead of, 20 commits behind hacktoberfest17/programming:master.

make_timer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 26, 2017
Oct 26, 2017
Oct 26, 2017
Oct 26, 2017

MakeTimer.js

example usage:

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

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

function thing(){
  if(count >= 0){
    timed.start(1000,aTimedThing,thing);
    // timed.start(duration,function,callback)
    // callback is not required. This example
    // is simply demonstrating it's usage.
  }
  if(count === 5){
    timed.stop()
  }
}

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

thing()