mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
d9ab5e81cf
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