Implement a custom timer as a function closing over start time.