Runtime.AvailableProcessors Method

Definition

Returns the number of processors available to the Java virtual machine.

[Android.Runtime.Register("availableProcessors", "()I", "GetAvailableProcessorsHandler")]
public virtual int AvailableProcessors ();
[<Android.Runtime.Register("availableProcessors", "()I", "GetAvailableProcessorsHandler")>]
abstract member AvailableProcessors : unit -> int
override this.AvailableProcessors : unit -> int

Returns

the maximum number of processors available to the virtual machine; never smaller than one

Attributes

Remarks

Returns the number of processors available to the Java virtual machine.

This value may change during a particular invocation of the virtual machine. Applications that are sensitive to the number of available processors should therefore occasionally poll this property and adjust their resource usage appropriately.

Added in 1.4.

Java documentation for java.lang.Runtime.availableProcessors().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to