added a timer output in the main loop