[UnityScript] yield for loop every other frame

I have a for loop in my Start function that runs through a set number of times doing intense calculations. Im creating hundreds of instances of prefabs then combining them into one mesh. This is really cool to watch if I use a yield; in the loop however it takes forever compared to letting it run in one frame. However I really hate those 5 seconds of being frozen and would like to have a loading bar stating the progress. Everything works except I can’t cause Unity to only pause every other frame. Ive tried this:

if(Time.frameCount % 2 == 0)
    yield;

but it doesn’t ever pause. I added a debug in there once and it only ran once. I don’t get this, is there simple but effective way to do this?

:D of course it doesn't pause because you don't yield!. How should Time.frameCount change when you don't yield? Use a local counter variable in your loop. If it's a for()-loop you can use the loop var

for (var i = 0; i < 1000; i++)
{
    [...]
    if(i % 2 == 0)
        yield;
}