My code has a function
void Generate()
{
for(...)
{
while(...)
{
...
}
StartCoroutine(waitFrame());
Debug.Log(time);
}
}
The generate function is called once in the Update() function when I press down a key.
I added the IEnumerator waitFrame() to avoid unity crashing since i'm going through a lot of data.
I wanted to see how much time each while loop took to complete by writing the time in the console with the Debug.Log(time); above, where time is updated in Update(). However nothing is writen in the console until the end of the loop, and the value of time is equal to 0 for each of the loops.
I'm guessing the loops in Generate() update independently from Update() as they would without the WaitForFrame, since a loop would normally execute within 1 frame.
My question is how can I debug updated values or change values in the inspector, like the time each while loop takes inside the for loop, inside my Generate() function containing a StartCoroutine(WaitForEndOfFrame);