コード例 #1
0
 /** end the time after a method is done. */
 public static void stopTimer() throws MetaException {
   Deadline deadline = getCurrentDeadline();
   if (deadline != null) {
     deadline.startTime = -1;
     deadline.method = null;
   } else {
     throw newMetaException(
         new DeadlineException(
             "The threadlocal Deadline is null," + " please register it firstly."));
   }
 }
コード例 #2
0
 /**
  * start the timer before a method is invoked.
  *
  * @param method
  */
 public static void startTimer(String method) throws MetaException {
   Deadline deadline = getCurrentDeadline();
   if (deadline != null) {
     deadline.startTime = System.currentTimeMillis();
     deadline.method = method;
   } else {
     throw newMetaException(
         new DeadlineException(
             "The threadlocal Deadline is null," + " please register it firstly."));
   }
 }