Here you can find the source of printTime(long time, String spacer)
public static String printTime(long time, String spacer)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { public static final String directionDummy = " "; public static String printTime(long time) { return printTime(time, ""); }//from w w w . j a v a 2 s . c om public static String printTime(long time, String spacer) { long minutes, seconds, milliseconds; minutes = (time / 1000) / 60; seconds = (time - minutes * 1000 * 60) / 1000; milliseconds = (time - seconds * 1000 - minutes * 1000 * 60); String result = directionDummy + spacer + "Time: "; result += String.format("%02d", minutes) + ":"; result += String.format("%02d", seconds) + "."; result += String.format("%03d", milliseconds); return result; } }