Adding elapsed time to timer function.