-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying a different requestAnimationFrame function #15
Comments
Hello, the documentation says that it can be used in Node.js with require('mainloop') |
As explained in #21, the comment above is incorrect - in Node.js, MainLoop.js uses a custom fallback for |
In terms of the one the library provides, would there be any advantage to scheduling the timeout to use Use case is running the loop in a worker which does not have requestAnimationFrame but does have performance |
I don't understand the question. |
Yes but in the fallback, you schedule it via passing Date.now (and an offset) to Would there be any advantage to using performance.now instead of Date.now ? |
The short answer is no, there wouldn't be a meaningful difference. The long answer is that the differences are:
|
This library currently uses
window.requestAnimationFrame
if available and falls back tosetTimeout
otherwise. The upcoming WebVR API will usedisplay.requestAnimationFrame
to schedule frames on attached VR displays. This library should support such loops.The text was updated successfully, but these errors were encountered: