calcualte totaltime and/or end time on save