0.0.5 • Published 5 years ago

time-buried v0.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

time-buried

Buried time point.

npm version Package Quality

Install

$ npm install time-buried

Burying start time and end time

const TimeBuried = require('time-buried');
const tB = new TimeBuried();

tB.start('launch');

setTimeout(() => {
    tB.end('launch');
    const value = tB.getValue('launch');
    
    // print: { startTimestamp: 1542784622547, endTimestamp: 1542784623551, diff: 1004 }
    console.log(value);
}, 1000)

Mutil points

const TimeBuried = require('time-buried');
const tB = new TimeBuried();

tB.start('launch');
tB.start('init');

setTimeout(() => {
    tB.end('launch');
    tB.end('init');
    const allValue = tB.getAllValue();
    
    // print: 
    // { 
    //     launch: { startTimestamp: 1542784622547,endTimestamp: 1542784623551, diff: 1004 },
    //     init: { startTimestamp: 1542784802011, endTimestamp: 1542784803013, diff: 1002 },
    // }
    console.log(allValue);
}, 1000)

Just Print

const TimeBuried = require('time-buried');
const tB = new TimeBuried();

tB.start('launch');
tB.start('init');

setTimeout(() => {
    tB.end('launch');
    tB.end('init');

    // print:
    // Time Recorder: ---- launch: 1002ms
    // Time Recorder: ---- init: 1004ms
    tB.printAll();
}, 1000)
0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago