List of utility methods to do Milliseconds
long | getMilliSeconds(String input) get Milli Seconds if (input.toLowerCase().endsWith("h")) { return Long.parseLong(input.replace("h", "")) * 60 * 60 * 1000; } else if (input.toLowerCase().endsWith("m")) { return Long.parseLong(input.replace("m", "")) * 60 * 1000; } else if (input.toLowerCase().endsWith("d")) { return Long.parseLong(input.replace("d", "")) * 24 * 60 * 60 * 1000; } else if (input.toLowerCase().endsWith("w")) { return Long.parseLong(input.replace("w", "")) * 7 * 24 * 60 * 60 * 1000; ... |
long | getMilliseconds(String time) get Milliseconds int lastPos = time.length() - 1; long t = Long.parseLong(time.substring(0, lastPos)); char c = time.charAt(lastPos); switch (c) { case 's': return t * MILLISECONDS; case 'm': return t * SECONDS * MILLISECONDS; ... |
long | getMilliseconds(String unixtime) get Milliseconds return Long.valueOf(unixtime) * 1000;
|
long | getMillisecondsFromTimeString(String timeString) get Milliseconds From Time String int minIndex = timeString.indexOf(':'); int min = Integer.parseInt(timeString.substring(0, minIndex).trim()); String secString = timeString.substring(minIndex + 1); int secIndex = secString.indexOf(':'); if (secIndex == -1) secIndex = secString.length(); int sec = Integer.parseInt(secString.substring(0, secIndex).trim()); return (min * 60 + sec) * 1000L; ... |
long | getMilliSecs() get Milli Secs return System.currentTimeMillis();
|
long | getMillisFromByteArray(byte[] buff, int offset) Extracts an milliseconds from seconds strored in a byte array. long result; result = (buff[offset + 0] & 0x000000ff) | ((buff[offset + 1] & 0x000000ff) << 8) | ((buff[offset + 2] & 0x000000ff) << 16) | ((buff[offset + 3] & 0x000000ff) << 24); result *= 1000L; return result; |
long | getMillisPartFromNanos(long nanos) getMillisPartFromNanos. return nanos > 999999 ? nanos / ONE_MILLION : 0;
|
int | getMillisSinceInit() get the number of milliseconds since first Util initialization return (int) (System.currentTimeMillis() - initTime); |
int | getNumSamplesForMillisAtSampleRate(final int sampleRate, final float millis) get Num Samples For Millis At Sample Rate return (int) getNumSamplesFloatForMillisAtSampleRate(sampleRate, millis); |
double | getOLEDateFromMillisRounded(long millis) get OLE Date From Millis Rounded return getOLEDateFromMillis(millis) + 1e-8;
|