Use an actual timer and a channel to communicate between the threads.