Notably Polite Mariner

    @abernier/loop

    1.0.4 • Public • Published

    NPM version

    INSTALL

    import Loop from 'https://unpkg.com/@abernier/loop@1.0.4'

    Usage

    At max speed (requestAnimationFrame):

    const myLoop = new Loop((t1, t0) => {
      console.log(`dt: ${t1 - t0}`)
    })
    
    myLoop.start()
    
    // ...
    
    myLoop.stop()

    At given speed (setTimeout):

    const myLoop = new Loop((t1, t0) => {
      console.log(`dt: ${t1 - t0}`)
    }, 1000)
    
    myLoop.start()
    
    // ...
    
    myLoop.stop()

    Keywords

    none

    Install

    npm i @abernier/loop

    DownloadsWeekly Downloads

    4

    Version

    1.0.4

    License

    ISC

    Unpacked Size

    3.81 kB

    Total Files

    4

    Last publish

    Collaborators

    • abernier