Skip to content
Browse files

Simple 1sec timer test

  • Loading branch information...
1 parent 6dda9bc commit aa15c89f8be22969717b7274f8ae073d3714c370 @erjiang committed Oct 26, 2010
Showing with 24 additions and 0 deletions.
  1. +24 −0 lwjgl1/src/Lwjgl1.java
View
24 lwjgl1/src/Lwjgl1.java
@@ -0,0 +1,24 @@
+import org.lwjgl.util.Timer;
+
+public class Lwjgl1 {
+
+ /**
+ * @param args
+ * @throws InterruptedException
+ */
+ public static void main(String[] args) throws InterruptedException {
+ // TODO Auto-generated method stub
+ Timer time = new Timer();
+
+ int i = 0;
+ float oldTime;
+
+ for (;;) {
+ oldTime = time.getTime();
+ time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();time.tick();
+ Thread.sleep(1000);
+ System.out.println("It's been " + (time.getTime() - oldTime)
+ + " seconds");
+ }
+ }
+}

0 comments on commit aa15c89

Please sign in to comment.
Something went wrong with that request. Please try again.