Wait time to avoid overloading CPU #2105
zoligyenge
started this conversation in
General
Replies: 1 comment 2 replies
-
On EV3, you need a wait in loops so that the Linux operating system has time to run in the background. On Powered Up hubs, there is no operating system, so we have the full CPU available. So it doesn't really hurt it to not have a time delay. The difference in power usage is negligible. But if you are using async/await programming then loops do need at least a The CPU timer resolution is 1 millisecond on Powered Up hubs, so a 10 ms wait time will work as expected and is a perfectly reasonable amount of time to wait in most control loops. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear Community
What wait time would you use in continuous loops to avoid overloading the CPU?
100ms, 10ms?
For example when checking continuously for collisions or checking motor positions, what freqeuncy is not overloading the CPU? Tech specs state the motors update sensor position at 100Hz, whcih would mean anything lower than wait (10ms) would not make sense, but is that too low for the CPU to handle?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions