Added ability to use a function as the `durationTime`.