Loop headers
The question would be that, which option uses less cpu:
HTML Code:
1. for(new i; i < ArraySize(dynamicArray); i++) |
Re: Loop headers
The second one. You want to aim at having the least number of native calls. Storing the value in a variable will result in ArraySize() being called only once, instead of ArraySize number of times.
|
Re: Loop headers
And why is that if I create a for loop like this
HTML Code:
for(new i; statement; i++) Then does this whole stuff look something like this? HTML Code:
for(<done at start>; <checked every loop>; <done every loop>) |
Re: Loop headers
You answered your own question. The first part is done when the loop is initiated.
Here's another way to look at it. PHP Code:
|
Re: Loop headers
Quote:
|
Re: Loop headers
To add to the first question:
If you used sizeof then for(...; i < sizeof; i++) would be fine since regular array sizes are known at compile time. |
Re: Loop headers
Thx, appreciate it!
|
All times are GMT -4. The time now is 05:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.