List of utility methods to do Milliseconds
long | samples2millis(long samples, double sampleRate) samplesmillis return 0L;
|
int | samplesToMilliseconds(int sampleRate, int samples) Calculates how many milliseconds samples are with sampleRate .
return Math.round((float) samples / sampleRate * 1000); |
void | setGlobalDebugMillis(int millis) If global debug should be on or off. globalDebugMillis = millis; |
Date | setMilliseconds(Date date, int amount) Sets the miliseconds field to a date returning a new object. return set(date, Calendar.MILLISECOND, amount);
|
int | setMilliSecondsFromSeconds(int seconds) used in the ListenerRegistryDAO the refresh_time in the DB is in second format. int msecs = 600000; msecs = seconds * 1000; return msecs; |
void | setThreadSleepTimeInMillis(long inThreadSleepTimeInMillis) set Thread Sleep Time In Millis threadSleepTimeInMillis = inThreadSleepTimeInMillis; |
String | stripMillisFromJdbcTimestampString(String timestamp) Strips off the millseconds value from a JDBC timestamp String returned from the MySQL JDBC connector. if (null != timestamp) { if (timestamp.contains(".")) { return timestamp.substring(0, timestamp.lastIndexOf('.')); } else { return timestamp; return null; ... |
String | stripSubMillis(String iso8601string) strip Sub Millis if (iso8601string.length() < isoDateWithSubMsMin || iso8601string.length() > isoDateWithSubMsMax) return iso8601string; String[] parts = splitOnFirst(iso8601string, '.'); String suffix = parts[1].substring(parts[1].length() - 6); String ms = parts[1].substring(0, 3); return parts[0] + "." + ms + suffix; |
String | strMillis(final long ns) str Millis if (ns < 1000) return ns + " ms"; StringBuilder sb = new StringBuilder(); for (int i = 0; i < MSTIMESET.length; i++) { if (ns >= MSTIMESET[i]) { long u = ns / MSTIMESET[i]; sb.append(Long.toString(u)); sb.append(MSSUFFIXES[i]); ... |
String | strMillisOLD(long dlt) str Millis OLD StringBuffer sb = new StringBuffer(); int millis = (int) (dlt % 1000); dlt /= 1000; boolean sp = false; if (dlt >= DAYS) { sb.append(dlt / DAYS); sb.append("D"); dlt %= DAYS; ... |