List of utility methods to do Time Elapsed
String | elapsedTime(long timeInMs) elapsed Time String r; long time = (int) (timeInMs / 1000); long secs = time % 60 > 0 ? time % 60 : 0; time = time / 60; long mins = time % 60 > 0 ? time % 60 : 0; time = time / 60; long hours = time % 24 > 0 ? time % 24 : 0; long days = time / 24; ... |
long | elapsedTimeMs(long start) Get the elapsed time in millisecond between the specified start time and now. return System.currentTimeMillis() - start;
|
String | elapsedTimeStamp(long time) put your documentation comment here StringBuffer sb = new StringBuffer(); elapsedTimeStampSection(time / 86400000L, "day", sb); elapsedTimeStampSection((time % 86400000L) / 3600000L, "hour", sb); elapsedTimeStampSection((time % 3600000L) / 1000L, "second", sb); return sb.toString(); |
void | elapsedTimeStampSection(long n, String label, StringBuffer sb) put your documentation comment here if (n > 0) { if (sb.length() > 0) sb.append(", "); sb.append(n); sb.append(' '); sb.append(label); if (n > 1) sb.append('s'); ... |
String | elapsedTimeString(long time) elapsed Time String final long DAY = 86400000; final long HOUR = 3600000; final long MIN = 60000; long remaintime = time; long days = remaintime / DAY; remaintime = remaintime - DAY * days; long hours = remaintime / HOUR; remaintime = remaintime - HOUR * hours; ... |