maintenance time calculation