Sleep between mesh changes


I create an operator, that create a mesh iteratively. I also create a new object with the mesh and link it to the scene, to see what was going wrong if my code crash. That works for me.
Now I want to see every step in blender.
If i use time.sleep(s) in every step blender dont update the scene until my operator finished.

How i can force blender to update the scene in every step?

i tried to use
bpy.ops.wm.redraw_timer(type=‘DRAW’, iterations=1)

but still blender draw the changes only if the operator is finished

bpy.ops.wm.redraw_timer(type=‘DRAW_WIN_SWAP’, iterations=1)
works :wink: