calculate worktime