SystemClock.sleep

来源:互联网 发布:asmr软件 编辑:程序博客网 时间:2024/05/17 02:59

http://developer.android.com/reference/android/os/SystemClock.html

与Thread.sleep不同的是,他不会抛出interruptedException;

static voidsleep(long ms)

Waits a given number of milliseconds (of uptimeMillis) before returning.

public static void sleep (long ms)

Added in API level 1

Waits a given number of milliseconds (of uptimeMillis) before returning. Similar to sleep(long), but does not throw InterruptedExceptioninterrupt() events are deferred until the next interruptible operation. Does not return until at least the specified number of milliseconds has elapsed.

Parameters
msto sleep before returning, in milliseconds of uptime.

0 0
原创粉丝点击