From d64c1a23795e4af1fcea1c1219b6453000d2c0ba Mon Sep 17 00:00:00 2001 From: hansonr Date: Fri, 25 Jan 2019 03:24:52 -0600 Subject: [PATCH] timing code --- src/jalview/util/Platform.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/jalview/util/Platform.java b/src/jalview/util/Platform.java index 0d7724b..1f03f88 100644 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@ -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; + } + } + } -- 1.7.10.2