You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

event-loop-ticks

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

event-loop-ticks

Get current event loop tick number. For educational purposes.

1.0.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

About

Packge will tell current number of executed event loop tick.

Numeration starts from 0.

For educational purposes only, do not use on production due to increased CPU usage.

TS:

import { tickNum } from 'event-loop-ticks';
console.log(tickNum());

JS:

const { tickNum } = require('event-loop-ticks');
console.log(tickNum());

Caveats

It is useful only to check if part of code were executed in the same or other tick.

Library is constantly 'spinning' in event lopp, so waiting for long timeout will cause tickNum() to return big values.

FAQs

Package last updated on 15 Apr 2021

Did you know?

Socket

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.

Install

Related posts