Java –利用可能なプロセッサの数を取得
ご使用の環境で使用可能なプロセッサー/コア/ CPUの数を取得する方法を示すコードスニペット。
int processors = Runtime.getRuntime().availableProcessors(); System.out.println(processors);
出力
8
P.S Tested with Intel® Core™ i7-4770 CPU @3.40GHz
ご使用の環境で使用可能なプロセッサー/コア/ CPUの数を取得する方法を示すコードスニペット。
int processors = Runtime.getRuntime().availableProcessors(); System.out.println(processors);
出力
8
P.S Tested with Intel® Core™ i7-4770 CPU @3.40GHz