執行緒操作
1 個節點
本頁內容 1
休眠
函數過載 1/2
簽名
休眠(超時(毫秒): 整數)
void Sleep(int millisecondsTimeout)
Pauses the thread running this code for at least the given number of milliseconds; the real pause is usually a little longer, by up to the system timer's resolution.
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 超時(毫秒) | 整數 | — | How long to pause, in milliseconds. 0 just gives up the rest of the current time slice, -1 (Timeout.Infinite) pauses forever, and anything below -1 throws System.ArgumentOutOfRangeException. |
過載 2/2
簽名
休眠(超時: TimeSpan)
void Sleep(TimeSpan timeout)
Pauses the thread running this code for at least the given length of time; the real pause is usually a little longer, by up to the system timer's resolution.
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 超時 | TimeSpan | — | How long to pause. Zero just gives up the rest of the current time slice and -1 millisecond pauses forever; anything below -1 millisecond or above Int32.MaxValue milliseconds (about 24.8 days) throws System.ArgumentOutOfRangeException. |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 執行緒操作
- 所屬包
- 標準庫