1.0.2 • Published 3 years ago

event-loop-ticks v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago