本文介绍了检测显卡性能-JS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个远景-是否可以通过JS插件检测不良或强大的图形卡性能?

This is a longshot - is there anyway to detect poor vs strong graphics card performance via a JS plugin?

我们已经为客户建立了一个视差站点,它在性能较低的计算机上停顿了-我们可以调整性能以使其在各个方面都能更好地工作-但这当然会减少使用高性能计算机的用户的体验.

We have built a parallax site for a client, it stutters on lower performance machines - we could tweak the performance to make it work better across the board - but this of course reduces the experience for users with higher performance machines.

我们还可以检测到浏览器版本-但同一浏览器可以在低性能计算机上运行-因此无济于事

We could detect browser version also - but the same browser could run on low and high performance machines - so doesn't help our situation

有什么想法吗?

推荐答案

requestAnimationFrame(rAF)可以帮助解决这个问题.

requestAnimationFrame (rAF) can help with this.

您可以使用rAF找出帧率.此处的详细信息:使用requestAnimationFrame在Canvas中计算FPS .简而言之,您可以找出帧之间的时间差,然后将其除以1(例如1/.0159s〜= 62fps).

You could figure out your framerate using rAF. Details about that here: calculate FPS in Canvas using requestAnimationFrame. In short, you figure out the time difference between frames then divide 1 by it (e.g. 1/.0159s ~= 62fps ).

注意:使用您选择的任何方法,性能将被任意决定.也许每秒超过24帧的任何东西都可以被认为是高性能".

Note: with any method you choose, performance will be arbitrarily decided. Perhaps anything over 24 frames per second could be considered "high performance."

这篇关于检测显卡性能-JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 23:49