Using Ao_timer for a better sleep
The problem is that the sleep can't be interrupted.
I often use a convenient loop like this
1 2 while running: 3 // do something 4 e32.ao_sleep(1) # sleep a sec
Now in pys60 1.3.1, it's better to use e32.Ao_timer
1 2 timer = e32.Ao_timer() 3 while running: 4 // do something 5 timer.after(1) # sleep a sec
I can then interupt the sleep with
1 timer.cancel()
in other part of the program if I need to continue the loop.
For example, I can end the application without waiting for
the last second.