GLib.get_num_processors

function get_num_processors(): Number(guint) {
    // Gjs wrapper for g_get_num_processors()
}
  

Determine the approximate number of threads that the system will schedule simultaneously for this process. This is intended to be used as a parameter to GLib.ThreadPool.new for CPU bound tasks and similar cases.

Since 2.36

Returns

Number of schedulable threads, always greater than 0