timelane

0.0.5 • Public • Published

Use it to track time of asynchronous events using explicit start, finish and timeout markers.

Usage

import createTimeline from 'timelane';

const timelines = {
    sleep: createTimeline(),
    awake: createTimeline()
};

Promise.resolve()
    .then(() => timelines.sleep.start())
    .then(() => ...)
    .then(() => timelines.sleep.finish({ metadata: 'moon was full' }))
    .then(() => timelines.awake.start())
    ...
    .then(() => timelines.awake.finish());

Each timeline will contain startedAt, finishedAt, timeoutAt and auto-evaluated duration.

That's it :)

/timelane/

    Package Sidebar

    Install

    npm i timelane

    Weekly Downloads

    8

    Version

    0.0.5

    License

    ISC

    Last publish

    Collaborators

    • inca