change timeFn to frameTime