Resource holding times: Computation and Optimization