Evaluate JS browser engine speed to conditionally disable animation

Is there a standard (accepted / simple / efficient) way to determine how fast the client machine creates javascript?

When I launch web applications (videos, etc.) on my other tabs, my JS animations slow down the scan.

If I could detect slowness from my JS, I would use simpler animations to provide a better user interface.

Update:

Removing animations for everyone is not the answer. I'm talking about the simplest animation, which stutters depending on the browser / computer. If I could detect the level of slowness, I would just turn them off.

This is the same as video games with dynamic graphics quality: you want to please people with old computers without punishing those who have extra computing power.

+5
source share
2 answers

One tip is to turn off hidden animations. if they are on another tab that is not in focus, what use is their animation?

Another is to keep the animation to a minimum. I assume you are in the DOM, and DOM operations are expensive. keep them to a minimum.

One piece of advice I got somewhere is if you are using image animation manipulation, consider using a canvas instead, so that you don't work in the DOM.

. . , - . , .


, , - , , .

0

, , . - . Javascript.

, , , cookie, .

- :

var starttime = new Date();
for( var i=0; i<1000000; i++ ) ;
var dt = new Date() - starttime;

, .

0

All Articles