Timer Sample

To see more JOM Software applications, click here.


timer_sample.py (v1.20)


Version History

Version 1.20, release date 2009-05-05

  • Timer callback problems when using class
  • Nothing happens
  • TypeError: callable expected for 2nd argument

Version 1.10, release date 2008-09-03

  • RunTimeError: negative number not allowed

Version 1.00, release date 2008-06-12

  • TypeError: bad argument type for built-in operation
  • TypeError: callable expected for 2nd argument
  • RuntimeError: maximum recursion depth exceeded
  • RunTimerError: Timer pending - cancel first
  • E32USER-CBase 91
  • Nothing happens

Tested with N82 (pyS60 1.4.3).

Code Samples

  • How to use Timer without callback
  • How to use Timer with callback without parameters
  • How to use Timer with callback with parameters
  • Eight (8) different ways to crash with Timer

Timer Sample

I tried to use timers for animation with limited, but not complete, success. Small sample code was easy, but 16 Puzzle v3.0 was growing up to 800+ lines of code. Somehow moving from simple Timer cases to more complex ones wasn't easy at all, something went wrong all the time. It just didn't scale up nicely.

Here I have documented all found errors you can make with Timer, how to identify each and fix them. There's a few correct ways, too, I hope.

My experiments continue, but it's beginning to look better.