Forcing editor to update while the script running

The context is the sequencer.
I want to take the location sample of the camera that was controlled by a CameraRigRail in various frame using python. My itnital idea was to call change_current_time() then get_world_location(). But it seem the script have to finish running first before the time and the camera location are updated along the time axis. Thus, I can only get the first location no matter which time I set.

Are there any way to force it update after setting current timeframe?