public class Sleep extends Object
| Constructor and Description |
|---|
Sleep() |
| Modifier and Type | Method and Description |
|---|---|
static void |
ignoreInterrupt(@NotNull Duration time)
ignore InterruptedException and immediately wake up with interrupted status
|
static void |
ignoreInterrupt(long ms)
ignore InterruptedException and immediately wake up with interrupted status
|
static long |
ignoreInterrupt(long min,
long max)
random sleep between min and max and return slept ms.
|
static void |
snoozeInterrupt(@NotNull Duration time)
ignore InterruptedException and continue to sleep, at the end wake up with interrupted status
|
static void |
snoozeInterrupt(long ms)
ignore InterruptedException and continue to sleep, at the end wake up with interrupted status
|
static long |
snoozeInterrupt(long min,
long max)
random sleep between min and max and return slept ms.
|
static void |
throwsInterrupt(@NotNull Duration time,
boolean keep)
throw IllegalStateException, and set whether to keep interrupted status
|
static void |
throwsInterrupt(long ms,
boolean keep)
throw IllegalStateException, and set whether to keep interrupted status
|
static void |
throwsInterrupt(long min,
long max,
boolean keep)
random sleep between min and max.
|
public static void ignoreInterrupt(@NotNull
@NotNull Duration time)
public static void ignoreInterrupt(long ms)
public static long ignoreInterrupt(long min,
long max)
public static void snoozeInterrupt(@NotNull
@NotNull Duration time)
public static void snoozeInterrupt(long ms)
public static long snoozeInterrupt(long min,
long max)
public static void throwsInterrupt(@NotNull
@NotNull Duration time,
boolean keep)
public static void throwsInterrupt(long ms,
boolean keep)
public static void throwsInterrupt(long min,
long max,
boolean keep)
Copyright © 2024. All rights reserved.