All pastes #912540 Raw Edit

grom358

public java v1 · immutable
·published 2008-02-21 13:19 UTC
rendered paste body
public class Test {	public static void main(String[] args) {		long count = 0;		long lastUpdate = System.nanoTime();				while(true) {			if (System.nanoTime() - lastUpdate > 1000000000L) {				// Print out count roughly every second				System.out.println(count);				count = 0;				lastUpdate = System.nanoTime();			}						try {				Thread.sleep(16); // 60 updates per second			} catch (InterruptedException ex) {				// do nothing			}			count++;					}	}}