Ticket #337 (defect)
Opened 2 years ago
Last modified 2 years ago
time.sleep() doesnt work
Status: closed (fixed)
| Reported by: | Tyger | Assigned to: | fraca7 |
|---|---|---|---|
| Priority: | major | Component: | psp2d |
| Version: | current | Keywords: | time sleep not working |
| Cc: |
time.sleep() seems not to work properly below 1 second. It will be ignored and proceed with next command on the next line w/o waiting. Time is a standard module, so I am confused that its not working. Interesting that time.clock() is working fine! You can run the following simple py-script to see that its not working properly:
# Sleep time tester import psp2d, time screen = psp2d.Screen() screen.clear(psp2d.Color(0, 0, 0)) time.sleep(1) screen.clear(psp2d.Color(50, 50, 50)) screen.swap() time.sleep(.8) screen.clear(psp2d.Color(100, 100, 100)) screen.swap() time.sleep(.4) screen.clear(psp2d.Color(100, 100, 100)) screen.swap() time.sleep(.2) screen.clear(psp2d.Color(150, 150, 150)) screen.swap() time.sleep(.1) screen.clear(psp2d.Color(200,200, 200)) screen.swap() time.sleep(1) screen.clear(psp2d.Color(0, 0, 0)) screen.swap()
It works fine in the PSP2D Dev environment just not on the PSP.
Attachments
Change History
01/21/07 22:48:12: Modified by pspuser
- attachment sleep_tester.py added.
01/27/07 11:19:46: Modified by fraca7
- status changed from new to closed.
- resolution set to fixed.
Fixed. time.sleep() should now have a resolution of 1e-6 seconds on the PSP.

Sleep time tester