I’m new to this forum so I hope I’m posting this in the right category .
I was thinking some steps through for my project (running on an ESP32) and I have a very short task that sometimes could be 1 if-statement and sometimes can take a few ms to run. Now the scheduler let’s task run for 1 tick (1ms) and then it will move on to the next scheduled task.
But I wonder what happens if the task is done running before the tick ends? Will it just idle your CPU for the rest of that tick? And if so, how should I properly implement it so I’m not wasting most of my CPU power waiting in a task?
Also, since all tasks run in an infinite while loop, the task will never be considered ‘done’, correct? So I guess if it doesn’t halt the CPU it will just run the if-statement one whole tick?
Thanks for any help.