直接调用System的currentTimeMillis()即可! long start = System.currentTimeMillis(); System.out.println("Start time : "+start);