List of utility methods to do Milliseconds
String | getDurationFromMillis(final long millis) Given a number of milliseconds, calculates a duration string. final long seconds = millis / 1000; final long minutes = seconds / 60; if (minutes == 0) { return seconds + "s ago"; final long hours = minutes / 60; if (hours == 0) { return minutes + "m ago"; ... |
Double | getDurationSecFromMillisDouble(long millis) get Duration Sec From Millis Double return (double) millis / 1000.00; |
long | getElapsedTimeInMilliseconds(Date startDate, Date endDate) Return the elapsed time between the start date and now. long startMilliseconds = startDate.getTime(); long endMilliseconds = endDate.getTime(); return endMilliseconds - startMilliseconds; |
long | getExpirationInMilliSeconds(long currentTime, int expirationTime) get Expiration In Milli Seconds long expiryInMsecs = ((long) expirationTime << 8); long diff = expiryInMsecs - currentTime; return (diff < 0L) ? 0L : diff; |
long | getExpirationMillisAbs(int recordExpirationTimestamp) get Expiration Millis Abs long timestamp; if (recordExpirationTimestamp == 0) { timestamp = -1; } else { timestamp = 1000L * (AS_TIMEBASE_SEC + recordExpirationTimestamp); return timestamp; |
long | getFullSecondsElapsedTimeMillis(long start, long end) Gets full seconds elapsed time millis. return ((long) Math.ceil((end - start) / 1000.0)) * 1000; |
String | getLogTimeFromMillis(Long millis) get Log Time From Millis return addLeadingZeros(String.valueOf(millis));
|
long | getMillis() get Millis return System.currentTimeMillis();
|
String | getMillis() get Millis return MILLIS;
|
long | getMillis(long ticks) Convert minecraft ticks to milliseconds. return (long) (ticks * 50D); |