1.0.3 • Published 6 years ago

timing-simple v1.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

timing-simple

timing simple plug-in

npm npm

this is a timing simple plug-in

Github: https://github.com/lienren/timing

Installation

$ npm install timing-simple

Examples

Before running the examples ensure you have timing-simple installed and enabled at the top of your script:

const timing = require('timing-simple');

Initialization & Run

let t = timing()
  .init()
  .run((count, time, unixtime) => {
    console.log('count:%s,time:%s,unixtime:%s', count, time, unixtime);
    return true;
  });

Default run frequency is 1 / sec, can be modified, see to Other Initialization

Stop

t.stop();

Run again

t.run((count, time, unixtime) => {
  console.log('count:%s,time:%s,unixtime:%s', count, time, unixtime);
  return true;
});

Return parameter

count: run times

time: now time, format: YYYY-MM-DD HH:mm:ss.SSS, for example: 2018-01-26 06:06:06.666

unixtime: now Unix time stamp

Other Initialization

let t = timing()
    .init(2000)
    ...

License

MIT - see LICENSE.md