I tried running clock in a separate thread for some reasons I am getting an error "main thread is not in main loop". Will have to see to it.