Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A bug fix - the undefined behavior of
idleCallbacks
's timeRemaining
.
Summary: ## Changelog: [Android] [Fixed] - Fix a bug that returns a random number from callback argument `timeRemaining` of `idleCallbacks` registered by `requestIdleCallbacks`. `global.performance.now()` returns a time from an unknown origin, while `frameTime` is epoch time. Thus, `global.performance.now() - frameTime` is just a random number rather than an elapsed time from the frame start time. As a simple solution, I would suggest to use `Date.now()`. Its resolution is lower than `frameTime` due to the security issue in JavaScript VM. So, it loses some precision, but, at least, it is not wrong. Reviewed By: javache Differential Revision: D40941461 fbshipit-source-id: b0094e181b97a844d133a9268fe48cd8c8fadfda
- Loading branch information