Add option for specifiying the duration to run.