Skip some code if the computer is slow

后端 未结 6 938
旧时难觅i
旧时难觅i 2021-02-04 09:27

Is there any way to detect if a computer is slow and not run some code (by either turning jQuery animations off or just running a function if it is fast)?

I kno

6条回答
  •  猫巷女王i
    2021-02-04 09:42

    I would like to point out that if you're going to leave it up to the user (which I think is a good idea) you should make it clear that you're asking about computer speed, not connection speed or bandwidth. A user may have a very fast laptop, but be working on a slow public wi-fi connection, or vice versa. Since Javascript is client-side, it's only the computer speed that matters.

提交回复
热议问题