Package uk.ac.manchester.spinnaker.utils
Class WaitUtils
java.lang.Object
uk.ac.manchester.spinnaker.utils.WaitUtils
public abstract class WaitUtils extends Object
Utilities for waiting very short periods of time.
- Author:
- Donal Fellows
-
Method Summary
Modifier and Type Method Description static boolean
waitUntil(long nanoTimestamp)
Wait until the given time has passed.
-
Method Details
-
waitUntil
Wait until the given time has passed. May decide to not wait at all.- Parameters:
nanoTimestamp
- The first time at which the code may return. If in the past, returns immediately.- Returns:
- Whether the wait stopped because the thread was interrupted. The caller must decide what to do in that case.
- See Also:
System.nanoTime()
,LockSupport.parkNanos(long)
, Stack Overflow
-