Added sleep duration as a run-time parameter