finscn Posted April 4, 2018 Share Posted April 4, 2018 I found there are some `new Date().getTime()` in Babylon's source , Why don't use `Date.now()` ? adam 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 4, 2018 Share Posted April 4, 2018 IE <= 9 support. Why dont we just add this polyfil? if (!Date.now) { Date.now = function now() { return new Date().getTime(); }; } Quote Link to comment Share on other sites More sharing options...
adam Posted April 4, 2018 Share Posted April 4, 2018 11 minutes ago, Pryme8 said: IE <= 9 support. BJS doesn't support IE <= 9. IE doesn't support WebGL until version 11. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 4, 2018 Share Posted April 4, 2018 well that would be the only reason to not use Date.Now() as it has more performance. So I second fin's question then, why do we not use it? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted April 4, 2018 Share Posted April 4, 2018 Reference should all be to BABYLON.Now. window.performance.now, if available uses more precision than getTime(). Pryme8 1 Quote Link to comment Share on other sites More sharing options...
adam Posted April 4, 2018 Share Posted April 4, 2018 perfomance.now will never be a bottleneck in BJS, but for educational purposes: https://jsperf.com/perf-vs-date/1 Quote Link to comment Share on other sites More sharing options...
finscn Posted April 5, 2018 Author Share Posted April 5, 2018 I think we should use `Date.now()` instead of `new Date().getTime()` Quote Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2018 Share Posted April 5, 2018 Will update all references to date.now in next commit Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.