元编程参考文档

线程操作

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.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
线程操作
所属包
标准库