Here you can find the source of formatMili(long timeDelta)
public static String formatMili(long timeDelta)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatMili(long timeDelta) { if (timeDelta < 1000) { return "" + timeDelta + " miliseconds"; } else if (timeDelta < 60000) { return "" + (double) timeDelta / 1000.0 + " seconds"; } else if (timeDelta < 3600000) { return "" + (double) timeDelta / 60000.0 + " minutes"; } else {/* w w w .jav a2s .c o m*/ return "" + (double) timeDelta / 3600000.0 + " hours"; } } }