Here you can find the source of elapsedTime(long milli)
public static String elapsedTime(long milli)
//package com.java2s; //License from project: Apache License public class Main { /**/* w ww . j a v a2s. c om*/ * Formats a time interval in milliseconds to a String in the form "hours:minutes:seconds:millis" */ public static String elapsedTime(long milli) { long seconds = milli / 1000; milli %= 1000; long minutes = seconds / 60; seconds %= 60; long hours = minutes / 60; minutes %= 60; return hours + "h " + minutes + "m " + seconds + "s " + milli; } }