Skip to content

Commit

Permalink
Moved all non-WIP stuff to ThreadTools
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaszTB committed Oct 31, 2024
1 parent 7fde7dc commit 38ff64c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/us/ihmc/commons/thread/ThreadTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,14 @@ public static void sleepForever()
}

/**
* Very similar to {@link #sleepSeconds(double)}, but uses {@link LockSupport#parkNanos} to sleep.
* Similar to {@link #sleepSeconds(double)}, but uses {@link LockSupport#parkNanos} to sleep.
* {@link LockSupport#parkNanos} is more accurate than {@link Thread#sleep}.
* The requested sleep is guaranteed to be at least as long as the requested
* amount and can be up to a nanosecond longer.
* <p>
* Also, while {@link #sleepSeconds(double)} swallows interrupts,
* this method will return upon being interrupted
* and the calling thread's interrupt status will be preserved.
*/
public static void park(double seconds)
{
Expand Down

0 comments on commit 38ff64c

Please sign in to comment.