Skip to content

Commit

Permalink
content: clarify process.nextTick() timing (#7204)
Browse files Browse the repository at this point in the history
  • Loading branch information
KunalKumar-1 authored Nov 16, 2024
1 parent d67507e commit 83081ef
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ authors: flaviocopes, MylesBorins, LaRuaNa, ahmadawais, ovflowd, marksist300

# Understanding process.nextTick()

As you try to understand the Node.js event loop, one important part of it is `process.nextTick()`. Every time the event loop takes a full trip, we call it a tick.
As you try to understand the Node.js event loop, one important part of it is `process.nextTick()`.
Every time the runtime calls back into JavaScript for an event, we call it a tick.

When we pass a function to `process.nextTick()`, we instruct the engine to invoke this function at the end of the current operation, before the next event loop tick starts:
When we pass a function to `process.nextTick()`, we instruct the engine to invoke this function immediately after the current operation completes, before moving to the next phase in the event loop:

```js
process.nextTick(() => {
Expand Down

0 comments on commit 83081ef

Please # to comment.