Here you can find the source of formatExecutionTime(long executionTime)
Parameter | Description |
---|---|
executionTime | current execution time in millis |
public static String formatExecutionTime(long executionTime)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w. j a va2 s.c o m * Format execution time for log. * * @param executionTime * current execution time in millis * @return */ public static String formatExecutionTime(long executionTime) { long min = executionTime / (1000 * 60L); executionTime = executionTime - min * 1000 * 60L; long sec = executionTime / 1000L; long millis = executionTime - sec * 1000L; StringBuilder sb = new StringBuilder(); sb.append(min + " min. "); sb.append(sec + " sec. "); sb.append(millis + " millis"); return sb.toString(); } }