Modify sum_time to use Time class.