Skip to content

Commit

Permalink
3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
odoldotol committed Jul 5, 2023
1 parent 925df59 commit e9e0ca2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 03-callbacks-and-events/ticker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ function ticker(number, callback) {
setTimeout(() => callback(tick_count), number);

const ticker50 = () => {
setTimeout(() => {
process.nextTick(() => {
emitter.emit('tick');
tick_count++;
});
setTimeout(() => {
ticker50();
}, 50);
};
Expand Down

0 comments on commit e9e0ca2

Please sign in to comment.