Java Get number of available processors
By:Roy.LiuLast updated:2019-08-17

A code snippet to show you how to get the number of available processors / cores / CPUs in your environment.
int processors = Runtime.getRuntime().availableProcessors(); System.out.println(processors);
Output
P.S Tested with Intel(R) Core(TM) i7-4770 CPU @3.40GHz
From:一号门
Previous:Spring ${} is not working in @Value
COMMENTS