Multithreading using timers