Quote:
Originally Posted by Ether
Sleep() makes the thread not runnable so it releases the processor so it doesn't waste resources polling the clock. The sleeping thread becomes runnable again when the sleep period has expired.
How is Timer.delay() implemented?
|
Code:
public static void delay(final double seconds) {
try {
Thread.sleep((long) (seconds * 1e3));
} catch (final InterruptedException e) {
}
}
From WPILibJ's source. I would expect that the C++ threads are implemented on top of
usleep(3).