Code example for TreeMap

Methods: containsKey, get, put

0
	 * 
	 * @param name the name 
	 */ 
	public void startTimer(String name) {
		create(name);
		store.get(name).start();
	} 
	 
	/** 
	 * Stop timer. 
	 * 
	 * @param name the name 
	 */ 
	public void stopTimer(String name) {
		create(name);
		store.get(name).stop();
	} 
	 
	/** 
	 * Report on timer. 
	 * 
	 * @param name the name 
	 */ 
	public void reportOnTimer(String name) {
		BenchmarkRow row = store.get(name);
		System.out.println(row.getName() + " is running for " + row.getDuration() + " ms");
	} 
	 
	/** 
	 * Creates the. 
	 * 
	 * @param name the name 
	 */ 
	private void create(String name) {
		if (store.containsKey(name) == false)
			store.put(name, new BenchmarkRow(name));
	} 
 
	/** 
	 * Report on all timer. 
	 */