-
|
Copilot came up with this explanation when running a tight loop:
So the effect is the same: MicroPython runs: If you write a tight loop like: while True: …you can easily: So MicroPython developers often use: time.sleep_ms(10) or even: await asyncio.sleep_ms(0) to yield control. Well, I have been working with the ESP32 for 5+ years and had never heard this before. It seems to be a major issue when working with an RTOS. Is this mentioned somewhere in the docs? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
|
I think it's Copilot making stuff up again. I'd never heard or experienced this before. The recommended "nice" function to use in a tight loop is machine.idle() |
Beta Was this translation helpful? Give feedback.
-
|
I'm afraid the main issue here is that AI is confidently telling you things which are almost entirely incorrect. (It's quite good at that, unfortunately.)
(The problem with our new exciting AI era is that it's taken ten minutes and my tired brain to write this answer, whereas Copilot can produce a short essay doubling down with even more nonsense in just a few seconds.) It is generally good to do a
Most of the parts which are real are, I think. |
Beta Was this translation helpful? Give feedback.
I think it's Copilot making stuff up again. I'd never heard or experienced this before.
The recommended "nice" function to use in a tight loop is machine.idle()