Which is more quickly evaluated? I'm using java syntax, but any programming language would apply to the question.
while (1==1) {
}
while (true) {
}
I tried testing this with a large loop. The results varied far too much to give me a solid answer.
What you are trying to do is a "micro optimisation". It's not worth it. Any decent compiler will produce identical code, since 1 == 1 is obviously the same as true. Even if it was different code, that little bit of change will not make any measurable difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With