Debug.Log for progress in editor

I am running large loops (taking around several minutes) in Editor script and looking how to print out the progress when loop is running. If I simply put Debug.Log() statement, everything gets printed at the end, when the loop is finished, while I would be interested to print out lets say iteration number when it’s calculating to get the progress. Does anyone know if it’s possible to do that?

You could wrap it in a coroutine that takes an Action as a parameter. Then when complete it invokes the action. Then inside the loop you do a Debug log and then yield return null before the next loop.