Added the tic() function in a timer callback