Here you can find the source of formatTimeElapsed(long p_millis)
Parameter | Description |
---|---|
p_millis | a parameter |
public static String formatTimeElapsed(long p_millis)
//package com.java2s; /* ********************************************************************* * * This file is part of Full Metal Galaxy. * http://www.fullmetalgalaxy.com//from w w w.ja v a 2 s.c om * * Full Metal Galaxy is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * Full Metal Galaxy is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public * License along with Full Metal Galaxy. * If not, see <http://www.gnu.org/licenses/>. * * Copyright 2010 to 2015 Vincent Legendre * * *********************************************************************/ public class Main { /** * format elapsed time from millisecond to human readable format * @param p_millis * @return */ public static String formatTimeElapsed(long p_millis) { // convert p_millis to minutes p_millis /= (1000 * 60); return "" + (p_millis / 60) + "h" + (p_millis % 60); } }