Added the option to use an external source time function