
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@ircam/ticker
Advanced tools
Execute a given callback at periodic interval, trying to minimize drift and jitter
Execute a given callback at periodic interval, trying to minimize drift and jitter.
npm install [--save] @ircam/ticker
import Ticker from '@ircam/ticker'
const period = 50; // in milliseconds
const ticker = new Ticker(period, (logicalTime, currentTime, error) => {
console.log(logicalTime, currentTime, error);
});
ticker.start();
Precise periodic timer (based on setTimeout
) that monitor and adapt itself
to stay close to the given therical period. In particular, try to minimize
the drift caused by the use of a raw setTimeout
.
Observed average jitter is around +/- 2ms.
Kind: global class
Param | Type | Description |
---|---|---|
period | Number | period of the timer interval in milliseconds (floored if float is given) |
callback | TickerCallback | callback to execute on each tick |
options | Object | additionnal options |
[options.errorThreshold] | Number | Threshold error where the timer considers itself as out of bounds. Increasing this value tends to increase the overall jitter. |
Number
Period of the timer. Must be an integer, the given value is floored. When updated the new value is applied at the next tick.
Kind: instance property of Ticker
Start the ticker instance.
Kind: instance method of Ticker
Stop the ticker instance.
Kind: instance method of Ticker
function
Kind: global typedef
Param | Type | Description |
---|---|---|
logicalTime | Number | logical time since start in ms |
currentTime | Number | current time as returned by performance.now |
error | Number | current error |
BSD-3-Clause
FAQs
Execute a given callback at periodic interval, trying to minimize drift and jitter
We found that @ircam/ticker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.