Code example for TimeUnit

Methods: toMinutestoSeconds

0
	 * @return 
	 */ 
	public static String getTime(long startTime, long endTime){
		long diff = endTime - startTime;
		return String.format("%d min, %d sec", 
			    TimeUnit.MILLISECONDS.toMinutes(diff),
			    TimeUnit.MILLISECONDS.toSeconds(diff) - 
			    TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(diff))
			); 
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE