I know this is old (long time I don't walk here...) but I wrote an article about how to control time using my Allegro.pas library. It uses "interruption-like". May be you can translate it to your favourite library.