public class SleepUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MS_IN_SEC |
static long |
NS_IN_MS |
static long |
NS_IN_SEC |
static int |
NS_IN_US |
static int |
US_IN_MS |
static long |
US_IN_SEC |
Constructor and Description |
---|
SleepUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
busySleep(long nanos) |
static void |
main(String[] args) |
static void |
pause() |
static void |
sleepMicros(int micros)
Sleep for the specific number of microseconds
|
static void |
sleepMillis(long millis)
Sleep for the specific number of milliseconds
|
static void |
sleepNanos(int nanos)
Sleep for the specified number of nanoseconds.
|
static long |
sleepNanos(int seconds,
long nanos) |
static void |
sleepSeconds(double secs)
Sleep for the specific number of seconds
|
static void |
sleepSeconds(int secs)
Sleep for the specific number of seconds
|
public static final int MS_IN_SEC
public static final long US_IN_SEC
public static final long NS_IN_SEC
public static final int NS_IN_US
public static final int US_IN_MS
public static final long NS_IN_MS
public static void sleepSeconds(int secs)
secs
- Number of seconds to sleep forpublic static void sleepSeconds(double secs)
secs
- Number of seconds to sleep forpublic static void sleepMillis(long millis)
millis
- Number of milliseconds to sleep forpublic static void sleepMicros(int micros)
micros
- Number of microseconds to sleep forpublic static void sleepNanos(int nanos)
nanos
- Number of nanosecondspublic static void pause()
public static void busySleep(long nanos)
public static long sleepNanos(int seconds, long nanos)
public static void main(String[] args)
Copyright © 2016–2017 mattjlewis. All rights reserved.