您的位置:首页 > 其它

[AS3] for/for in/for each,which one is faster?

2012-06-19 16:09 471 查看
"""

regular
"for"
loops are moderately faster than
for each
loops in the minimal case.

Also, as with AS2 days, decrementing your way through a
for
loop generally provides a very minor improvement.

But really, any slight difference here will be dwarfed by the requirements of what you actually do inside the loop. You can find operations that will work faster or slower in either case. The real answer is that neither kind of loop can be meaningfully said to be faster than the other - you must profile your code as it appears in your application.

"""
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐