It is likely because the brief moment of CPU time consumed by the console.log is exposing that theres a race condition in your code somewhere. Replace the console.log with a wait/sleep/delay and see if it still crashes, if it does you have a race condition somewhere.
I figured it had to be something like that, but for my purposes it works as it is, so I decided to leave well enough alone. It is just a personal project that I use occasionally.
View all comments
Show parent comment
1
u/LadyZaryss Oct 11 '26 edited Oct 11 '26
It is likely because the brief moment of CPU time consumed by the console.log is exposing that theres a race condition in your code somewhere. Replace the console.log with a wait/sleep/delay and see if it still crashes, if it does you have a race condition somewhere.