What type of loops do you use? #1422
Unanswered
espruino-discuss
asked this question in
JavaScript
Replies: 2 comments
-
Posted at 2020-07-31 by @gfwilliams It's not an entirely fair comparison if you've got The fastest would be:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Posted at 2020-07-31 by @MaBecker Well not sure about this, isn't
Any way it is clear that while loops are faster than for loops. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-07-31 by @MaBecker
There has been a lot talking about loop performance.
So lets's try to find out if there is a difference between loops and loops.
Tested on an original Espruino board so others may differ for the time but not for the result.
Test code snipped with for, while and do.
testing:
As a result: Try to use do or while loops instead of for loops , they run nearly twice as long.
Beta Was this translation helpful? Give feedback.
All reactions