precision-timeout-interval

    1.0.4 • Public • Published

    precision-timeout-interval

    node workflow badge node workflow badge node workflow badge node workflow badge node workflow badge node workflow badge

    demo preview

    High precision timeout and interval methods for javascript

    Click here for live demo

    Installation

    npm i precision-timeout-interval

    Timeout usage

    prcTimeout( delayTimeInMilliseconds , callbackFunction )

    const { prcTimeout } = require("precision-timeout-interval");
    prcTimeout(delayTime, ()=>console.log("hello world") ) // callback function will be executed only once

    Interval usage

    prcInterval( delayTimeInMilliseconds , callbackFunction )

    const { prcInterval } = require("precision-timeout-interval");
    let intervalController = prcInterval(delayTime, ()=>console.log("hello world") ) // callback function will be executed every delayTime milliseconds
    console.log(intervalController) // { end: false }
    intervalController.end = true // stops the interval permanently

    Install

    npm i precision-timeout-interval

    DownloadsWeekly Downloads

    9

    Version

    1.0.4

    License

    ISC

    Unpacked Size

    192 kB

    Total Files

    15

    Last publish

    Collaborators

    • ufukbakan