예제 #1
0
파일: Timer.java 프로젝트: RCCDEV/ashley
 /**
  * Stop tracking the specified id
  *
  * @param name The timer's id
  * @return the elapsed time
  */
 public long stop(String name) {
   if (times.containsKey(name)) {
     long startTime = times.remove(name);
     return System.currentTimeMillis() - startTime;
   } else throw new RuntimeException("Timer id doesn't exist.");
 }
예제 #2
0
파일: Timer.java 프로젝트: RCCDEV/ashley
 /**
  * Start tracking a time with name as id.
  *
  * @param name The timer's id
  */
 public void start(String name) {
   times.put(name, System.currentTimeMillis());
 }