public static void stopTimer(String name){
  long stopTime=System.nanoTime();
  Long startTime=openTimers.remove(name);
  if (startTime == null) {
    throw new IllegalArgumentException("timer does not exist");
  }
  SummaryStatistics statistics=data.get(name);
  if (statistics == null) {
    statistics=new SummaryStatistics();
    data.put(name,statistics);
  }
  statistics.addValue(stopTime - startTime);
}

public static void stopTimer ( String name ) { long stopTime = System . nanoTime ( ) ; Long startTime = openTimers . remove ( name ) ; if ( startTime == null ) { throw new IllegalArgumentException ( "timer does not exist" ) ; } SummaryStatistics statistics = data . get ( name ) ; if ( statistics == null ) { statistics = new SummaryStatistics ( ) ; data . put ( name , statistics ) ; } statistics . addValue ( stopTime - startTime ) ; }
stops the timer with the specified name .
