Here you can find the source of toTimeHumanReadable(final long time)
Parameter | Description |
---|---|
time | time in ms |
public static final String toTimeHumanReadable(final long time)
//package com.java2s; /*//from www . j ava2s . c om * Teolenn development code * * This code may be freely distributed and modified under the * terms of the GNU General Public License version 2 or later. This * should be distributed with the code. If you do not have a copy, * see: * * http://www.gnu.org/licenses/gpl-2.0.txt * * Copyright for this code is held jointly by the microarray platform * of the ?cole Normale Sup?rieure and the individual authors. * These should be listed in @author doc comments. * * For more information on the Teolenn project and its aims, * or to join the Teolenn Google group, visit the home page * at: * * http://www.transcriptome.ens.fr/teolenn * */ public class Main { /** * Convert a number of milliseconds into a human reading string. * @param time time in ms * @return a the time in ms */ public static final String toTimeHumanReadable(final long time) { long min = time / (60 * 1000); long minRest = time % (60 * 1000); long sec = minRest / 1000; long mili = minRest % 1000; return String.format("%02d:%02d.%03d", min, sec, mili); } }