An example Kotlin code snippet to show you how to get the number of available processors / cores / CPUs in your environment.

Get Available CPU's in Kotlin


You can also use this method to find number of cores in Java as well.


Output might vary depending on your machine. Here's the number of CPU available in my local machine