neo-timer
neo-timer --
Last updated 11 years ago by suguru03 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install neo-timer 
SYNC missed versions from official npm registry.

neo-timer

neo-timer can be used as a timer or stopwatch.

The timer is selected automatically by your environment.

functions

init

start

diff

lap

result

example


'use strict';

var Timer = require('../');
var timer = new Timer({
  MAX_LAP_LENGTH: 100
});

var count = 0;
var times = 100;

timer.init().start();

var iter = function() {
  setTimeout(function() {
    clearTimeout(iter);
    timer.lap();
    if (count === times) {
      console.log(timer.result());
    } else {
      iter();
    }
  }, Math.random() * 10 * ++count);
};

iter();

graph

Current Tags

  • 0.2.0                                ...           latest (11 years ago)

2 Versions

  • 0.2.0                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 4
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 3
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE