
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@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. |
NumberPeriod 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
functionKind: 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 discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.