Added ability to use a function as the `durationTime`.
Merge pull request #116 from hdanak/master

Use a function as `durationTime`