timers-browserify

WebJar for timers-browserify

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

timers-browserify
Last Version

Last Version

2.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

timers-browserify
WebJar for timers-browserify
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/browserify/timers-browserify

Download timers-browserify

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/timers-browserify/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>timers-browserify</artifactId>
    <version>2.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/timers-browserify/
implementation 'org.webjars.npm:timers-browserify:2.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/timers-browserify/
implementation ("org.webjars.npm:timers-browserify:2.0.12")
'org.webjars.npm:timers-browserify:jar:2.0.12'
<dependency org="org.webjars.npm" name="timers-browserify" rev="2.0.12">
  <artifact name="timers-browserify" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='timers-browserify', version='2.0.12')
)
libraryDependencies += "org.webjars.npm" % "timers-browserify" % "2.0.12"
[org.webjars.npm/timers-browserify "2.0.12"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : setimmediate jar [1.0.4,2)

Project Modules

There are no modules declared in this project.

Overview

Adds support for the timers module to browserify.

Wait, isn't it already supported in the browser?

The public methods of the timers module are:

  • setTimeout(callback, delay, [arg], [...])
  • clearTimeout(timeoutId)
  • setInterval(callback, delay, [arg], [...])
  • clearInterval(intervalId)

and indeed, browsers support these already.

So, why does this exist?

The timers module also includes some private methods used in other built-in Node.js modules:

  • enroll(item, delay)
  • unenroll(item)
  • active(item)

These are used to efficiently support a large quantity of timers with the same timeouts by creating only a few timers under the covers.

Node.js also offers the immediate APIs, which aren't yet available cross-browser, so we polyfill those:

  • setImmediate(callback, [arg], [...])
  • clearImmediate(immediateId)

I need lots of timers and want to use linked list timers as Node.js does.

Linked lists are efficient when you have thousands (millions?) of timers with the same delay. Take a look at timers-browserify-full in this case.

License

MIT

org.webjars.npm

Versions

Version
2.0.12
2.0.11
2.0.10
2.0.6
2.0.2
1.4.2
1.0.1