Class ThreadUtils
java.lang.Object
com.igormaznitsa.meta.common.utils.ThreadUtils
Auxiliary methods for thread processing.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
silentSleep
(long milliseconds) Just suspend the current thread for defined interval in milliseconds.static int
Get the stack call depth for the caller.static StackTraceElement
Get the stack element of the method caller.
-
Constructor Details
-
ThreadUtils
private ThreadUtils()
-
-
Method Details
-
silentSleep
Just suspend the current thread for defined interval in milliseconds.- Parameters:
milliseconds
- milliseconds to sleep- Returns:
- false if the sleep has been interrupted by InterruptedException, true otherwise.
- Since:
- 1.0
- See Also:
-
stackElement
Get the stack element of the method caller.- Returns:
- the stack trace element for the calling method.
- Since:
- 1.0
-
stackDepth
Get the stack call depth for the caller.- Returns:
- the caller method stack depth.
- Since:
- 1.0
-