24
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JavaScriptからCPUのコア数を確認する

Posted at

navigator.hardwareConcurrencyにコア数が入ってる。

image

用途

重い処理をするときにどれくらい負荷かけても大丈夫かをコア数から判断するとか。

WebGL使うときにコア数見て弱そうならクオリティ下げるとか?

実装

今のところ確認できたのはChromeだけ。

polyfillがある

Firefoxで確認したらきっちりコア数を当てられたけど力技感がありそうな挙動。


3Dとかゲーム系とかで使われるようになりそう

24
22
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?