Added timer function.