The entire closure is executed in the frame, that includes calling print, evaluating values in print statement, everything in the closure.
No Lua code is called at the very moment transition time elapses. The execution is scheduled to happen in the next frame (when the Lua interpreter takes over to handle listeners, etc.).
Timed versus Frame
You misunderstand me I think.
Corona is essentially a simulation. It has a bunch of tasks to execute. It executes those tasks in a specific order every ‘cycle’.
While I have not seen the actual source code, I can say with some certainty that the basic cycle (which is equivalent to one frame) is split into two major parts:
A. Timed Part - Timer advancement, transition advancement, physics, …, all of the non-Lua behind the scenes stuff. In this half/part of the cycle, events will occur and be detected that cause Corona to schedule the execution of listeners, functions in timers, etc. All of this scheduled Lua work occurs in the next half/part of the cycle.
The timed part can take a variable amount of time, but will take only the amount of time it needs and then gives up the rest of the time in the frame to the Lua interpreter.
B. Frame Part (or what we in our scripts see of it) - Here, all the Lua excution occurs. The Lua interpreter is started up and give a load of work to do based on what happened in the timed part.
This part also can run for an unknown amount of time and will keep running till all the scripts are complete.
Tip: When you see frame rate drops and your graphics/physics are light, it is a good bet you’re doing too much work in the scripts that hold up this part of a frame.
Back to your original post…
All I’m saying above is that the timers and transitions are executing and completing in part A. However the scripts associated with that completion is not executed immediately. It waits till part B. So your scheduled transition duration will be shorter than the actual duration between when the transition started, and when the onComplete closure executes.
Also, I’ll say it once more…
You simply CANNOT schedule transitions in a loop (all in the same execution cycle) and have any hope that they will execute perfectly back to back.
You must instead, execute one transition, and start the next consecutive one in the onComplete of the ending transition.