package org.robockets.buttonmanger;

public class ButtonThread implements Runnable {
	private long startTime = 0;

	public void run() {
		while (true) {
			setTimeout();
			ButtonManager.checkButtons();
			waitUntilTimedOut();
		}
	}
	
	private void setTimeout() {
		startTime = System.nanoTime();
	}
	
	private void waitUntilTimedOut() {
		while (System.nanoTime() >= startTime + 1000000000) { // 1000000000ns should be 1s
			// Just wait
		}
	}
}

package org.robockets.buttonmanger;

public class ButtonThread implements Runnable {
	private long startTime = 0;

	public void run() {
		while (true) {
			setTimeout();
			ButtonManager.checkButtons();
			waitUntilTimedOut();
		}
	}
	
	private void setTimeout() {
		startTime = System.nanoTime();
	}
	
	private void waitUntilTimedOut() {
		while (System.nanoTime() == startTime + 1000000000) { // 1000000000ns should be 1s
			// Just wait
		}
	}
}

--- 
+++ 
@@ -16,7 +16,7 @@
 	}
 	
 	private void waitUntilTimedOut() {
-		while (System.nanoTime() == startTime + 1000000000) { // 1000000000ns should be 1s
+		while (System.nanoTime() >= startTime + 1000000000) { // 1000000000ns should be 1s
 			// Just wait
 		}
 	}
Make sure wait function catches everything
