Do for loops iterate once per frame? Until the condition is false all in a single frame? Or simply as fast as it can, taking as many frames as it needs?
A basic for loop or foreach or while loop goes within the frame
So if you iterate a large amount of objects you may see a little stop in your game or even a big stop.
You can cut your loop into smaller parts using a coroutine.
For instance if you know you are about to look into a large collection:
IEnumerator IterateLargeCollection(object[] arr)
{
float frequency = 1000;
for (int i = 0;i<arr.Lenght;i++){
//Do your stuff
if(i == frequency)yield return null;
}
}
Every 1000 objects, the loop goes out and comes back where it left off. You can also pack the 1000 objects and return them so that you can use them somewhere else. Well it all depends on what you want to do.
Maybe you did not need that much information…