Share via


ThreadPoolExecutor.GetKeepAliveTime(TimeUnit) Method

Definition

Returns the thread keep-alive time, which is the amount of time that threads may remain idle before being terminated.

[Android.Runtime.Register("getKeepAliveTime", "(Ljava/util/concurrent/TimeUnit;)J", "GetGetKeepAliveTime_Ljava_util_concurrent_TimeUnit_Handler")]
public virtual long GetKeepAliveTime (Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("getKeepAliveTime", "(Ljava/util/concurrent/TimeUnit;)J", "GetGetKeepAliveTime_Ljava_util_concurrent_TimeUnit_Handler")>]
abstract member GetKeepAliveTime : Java.Util.Concurrent.TimeUnit -> int64
override this.GetKeepAliveTime : Java.Util.Concurrent.TimeUnit -> int64

Parameters

unit
TimeUnit

the desired time unit of the result

Returns

the time limit

Attributes

Remarks

Returns the thread keep-alive time, which is the amount of time that threads may remain idle before being terminated. Threads that wait this amount of time without processing a task will be terminated if there are more than the core number of threads currently in the pool, or if this pool #allowsCoreThreadTimeOut() allows core thread timeout.

Java documentation for java.util.concurrent.ThreadPoolExecutor.getKeepAliveTime(java.util.concurrent.TimeUnit).

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

See also

  • <xref:Java.Util.Concurrent.ThreadPoolExecutor.SetKeepAliveTime(System.Int64%2c+Java.Util.Concurrent.TimeUnit)>