compute endTime in run method