Basic code to handle timers