Code example for TimeUnit

Methods: convert

0
      return timeCosts(TimeUnit.MILLISECONDS);
   } 
    
   public long timeCosts(TimeUnit unit) {
      long timeCosts = (endTimeMillis - startTimeMillis);
      return TimeUnit.MILLISECONDS.convert(timeCosts, unit);
   } 
    
   public void reset() { 
      this.startTimeMillis = this.endTimeMillis = 0;
   } 
 
   public long getStartTimeMillis() { 
      return startTimeMillis;
   } 
 
   public void setStartTimeMillis(long startTimeMillis) {
      this.startTimeMillis = startTimeMillis;
   } 
 
   public long getEndTimeMillis() {