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 毫秒。

適用於