@Test public void useLogElapsedTime() throws Exception { long begin = System.currentTimeMillis(); TimeUnit.MILLISECONDS.sleep(50); DebugUtils.logElapsedTime(begin, "com.orientsec.grpc.common.util.DebugUtilsTest.logElapsedTime"); }
public static void logElapsedTime(long beginMillis, String functionDesc) { if (!DEBUG) { return; } long end = System.currentTimeMillis(); long elapsed = end - beginMillis; if (elapsed <= 0) { return; } String message = LOG_PREFIX + "功能[" + functionDesc + "]消耗的时间为[" + elapsed + "]毫秒"; logger.info(message); }
DebugUtils { public static void logElapsedTime(long beginMillis, String functionDesc) { if (!DEBUG) { return; } long end = System.currentTimeMillis(); long elapsed = end - beginMillis; if (elapsed <= 0) { return; } String message = LOG_PREFIX + "功能[" + functionDesc + "]消耗的时间为[" + elapsed + "]毫秒"; logger.info(message); } }
DebugUtils { public static void logElapsedTime(long beginMillis, String functionDesc) { if (!DEBUG) { return; } long end = System.currentTimeMillis(); long elapsed = end - beginMillis; if (elapsed <= 0) { return; } String message = LOG_PREFIX + "功能[" + functionDesc + "]消耗的时间为[" + elapsed + "]毫秒"; logger.info(message); }  }
DebugUtils { public static void logElapsedTime(long beginMillis, String functionDesc) { if (!DEBUG) { return; } long end = System.currentTimeMillis(); long elapsed = end - beginMillis; if (elapsed <= 0) { return; } String message = LOG_PREFIX + "功能[" + functionDesc + "]消耗的时间为[" + elapsed + "]毫秒"; logger.info(message); }  static void logElapsedTime(long beginMillis, String functionDesc); static void logElapsedNanotime(long beginNanos, String functionDesc); }
DebugUtils { public static void logElapsedTime(long beginMillis, String functionDesc) { if (!DEBUG) { return; } long end = System.currentTimeMillis(); long elapsed = end - beginMillis; if (elapsed <= 0) { return; } String message = LOG_PREFIX + "功能[" + functionDesc + "]消耗的时间为[" + elapsed + "]毫秒"; logger.info(message); }  static void logElapsedTime(long beginMillis, String functionDesc); static void logElapsedNanotime(long beginNanos, String functionDesc); static final boolean DEBUG; }