Allow specifying time function