package LeetCode;

import java.util.Hashtable;

public class Main {
	public static void main(String[] args) {
		System.out.print("app start!\r\n");
	}
	
	private static Hashtable<String, Long> timerData = new Hashtable<String, Long>();
	
	static void startTimer(String key) throws Exception{
		if(timerData.containsKey(key)){
			throw new Exception("duplicate timer key:" + key);
		}
		timerData.put(key, System.nanoTime());
	}
	
	static long endTimer(String key) throws Exception{
		if(!timerData.containsKey(key)){
			throw new Exception("timer key not exist:" + key);
		}
		long timeSpan = System.nanoTime() - timerData.get(key);
		timerData.remove(key);
		return timeSpan;
	}
}
@@ -110,46 +110,125 @@
 gs) 
-%7B%0D%0A%09%09System.out.print(%22app start!%5Cr%5Cn%22
+throws Exception %7B%0D%0A%09%09startTimer(%22time%22);%0D%0A%09%09System.out.print(%22app start!%5Cr%5Cn%22);%0D%0A%09%09System.out.print(endTimer(%22time%22)
 );%0D%0A
@@ -569,24 +569,57 @@
 Exception%7B%0D%0A
+%09%09long now = System.nanoTime();%0D%0A
 %09%09if(!timerD
@@ -720,33 +720,19 @@
 eSpan = 
-System.nanoTime()
+now
  - timer

move some code to another place