timing code
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Fri, 25 Jan 2019 09:24:52 +0000 (03:24 -0600)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Fri, 25 Jan 2019 09:24:52 +0000 (03:24 -0600)
src/jalview/util/Platform.java

index 0d7724b..1f03f88 100644 (file)
@@ -198,4 +198,26 @@ public class Platform
   {
        return !isMac();
   }
+  
+  public final static int TIME_RESET = 0;
+  public final static int TIME_MARK  = 1;
+  
+  public static long time, mark;
+  
+  public static void timeCheck(String msg, int mode) {
+         switch (mode) {
+         case TIME_RESET:
+                 time = mark = System.currentTimeMillis();
+                 System.err.println("Platform: timer reset\t\t\t" + msg);
+                 break;
+         case TIME_MARK:
+                 long t = System.currentTimeMillis();
+                 if (time == 0)
+                         time = mark = t;
+                 System.err.println("Platform: timer mark\t" + ((t - time)/1000f) + "\t" + ((t - mark)/1000f) + "\t" + msg);
+                 mark = t;
+                 break;
+         }
+  }
+   
 }