Timeout.InfiniteTimeSpan 欄位

定義

一個常數,用來指定無限等待期,適用於接受參數 TimeSpan 的方法。

public: static initonly TimeSpan InfiniteTimeSpan;
public static readonly TimeSpan InfiniteTimeSpan;
[System.Runtime.InteropServices.ComVisible(false)]
public static readonly TimeSpan InfiniteTimeSpan;
 staticval mutable InfiniteTimeSpan : TimeSpan
[<System.Runtime.InteropServices.ComVisible(false)>]
 staticval mutable InfiniteTimeSpan : TimeSpan
Public Shared ReadOnly InfiniteTimeSpan As TimeSpan 

欄位值

屬性

備註

對於接受 timeout 參數 TimeSpan為 的執行緒方法,例如 Thread.Sleep(TimeSpan)Thread.Join(TimeSpan),此值用於無限懸掛執行緒。 然而,在大多數情況下,我們建議你使用其他 System.Threading 類別,例如 MutexMonitorEventWaitHandleSemaphore ,來同步執行緒或管理資源。

此場的值為 -00:00:00.0010000,或 -1 毫秒。

適用於