3 ms·Except for the fact that using foreach instead of for has no impact on your O(n) performance.by sailingparrot 4y agoExcept for the fact that using foreach instead of for has no impact on your O(n) performance.