Here you can find the source of getPerformanceTime(Timestamp startTime)
Parameter | Description |
---|---|
startTime | the start time |
public static String getPerformanceTime(Timestamp startTime)
//package com.java2s; import java.sql.Timestamp; public class Main { /**//from ww w . j av a 2 s . c om * Gets the performance time. * * @param startTime * the start time * @return the performance time */ public static String getPerformanceTime(Timestamp startTime) { return getTimeDifference(startTime, new Timestamp(System.currentTimeMillis())); } /** * Gets the time difference. * * @param startTime * the start time * @param endTime * the end time * @return the time difference */ public static String getTimeDifference(Timestamp startTime, Timestamp endTime) { long timeInMilliseconds = endTime.getTime() - startTime.getTime(); int seconds = (int) (timeInMilliseconds / 1000); int minutes = seconds / 60; int milliseconds = (int) (timeInMilliseconds % 1000); return minutes + " minute(s) " + seconds + " second(s) " + milliseconds + " millisecond(s)"; } }