def endTimer(data, current_time): start = data[0]['start_time'] pause = data[0]['pause'] total_workspan = checkmetools.timeDifference(current_time, start) total_timespan = total_workspan - computeTotalPause(pause) data[0]['total_workspan'] = total_workspan data[0]['total_timespan'] = total_timespan data[0]['end_time'] = current_time return data
def setDuration(pause, current_time): pause['duration'] = checkmetools.timeDifference(current_time, pause['start']) pause['end'] = current_time return pause