1.0.0 • Published 9 years ago

xtimer v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

xtimer

Lightweight solution for timers with timeouts and intervals

Install

npm install xtimer

Get started

This peace of code

const timer = require("xtimer")

timer({
  timeout: 0,
  interval: 1000,
  callback: function(...args) {
    console.log(...args)
  },
  args: [1, "second", { a: 1 }]
})

Will output into the console every second without timeout

1 'second' { a: 1 }

Options

It's the object to pass into timer function

requirednametypedescriptiondefault
yescallbackFunctionfunction to execute
noargsArrayarguments to pass into callback[]
nointervalNumbertime in ms between callback calls100
notimeoutNumbertimeout before first call0