Object
XThread
Additions to standard java.lang.Thread
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
sleep
(long msec) Standard way to sleep in Java is pretty verbose because it throws checked exception which you need to handle:
-
Constructor Details
-
XThread
public XThread()
-
-
Method Details
-
sleep
public static void sleep(long msec) Standard way to sleep in Java is pretty verbose because it throws checked exception which you need to handle:try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException(e); }
When you write scripts in Java you probably want it to fit in one line and wrap any thrown exception to unchecked.
XThread.sleep(1000);
- Parameters:
msec
- how long to sleep in milliseconds. -1 - sleep forever
-