1.0.4 • Published 2 years ago

@abernier/loop v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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()
1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

4 years ago

1.0.0

4 years ago