List of utility methods to do Time Print
String | printTime(long millis) print Time long second = (millis / 1000) % 60; long minute = (millis / (1000 * 60)) % 60; long hour = (millis / (1000 * 60 * 60)) % 24; String time = String.format("%02d:%02d:%02d:%d", hour, minute, second, millis); return time; |
void | printTime(long starttime, long endtime) Prints the TIME difference long totaltime = (endtime - starttime) / 1000; System.out.print("\nTime Taken: [Hours: " + totaltime / 60 / 60 + ", Minutes: " + totaltime / 60 % 60 + ", Seconds: " + totaltime % 60 % 60 + "]"); |
String | printTime(long time, String spacer) print Time long minutes, seconds, milliseconds; minutes = (time / 1000) / 60; seconds = (time - minutes * 1000 * 60) / 1000; milliseconds = (time - seconds * 1000 - minutes * 1000 * 60); String result = directionDummy + spacer + "Time: "; result += String.format("%02d", minutes) + ":"; result += String.format("%02d", seconds) + "."; result += String.format("%03d", milliseconds); ... |
void | printTime(String msg) print Time System.out.println("Time: (" + System.currentTimeMillis() + ") " + msg); |
void | printTimer(String blah) print Timer System.out.println("TIMER: " + blah + (System.currentTimeMillis() - time));
time = System.currentTimeMillis();
|
void | printTimes(String what, long... args) _more_ System.out.print(what + " "); for (int i = 1; i < args.length; i++) { System.out.print(" " + (args[i] - args[i - 1])); System.out.println(" total: " + (args[args.length - 1] - args[0])); |
void | printTimestamp() print Timestamp long diff = System.currentTimeMillis() - LAST_TIMESTAMP; resetTimestamp(); System.out.printf("TIME: %,11dms", new Long(diff)); |
void | printTimeStamp(final String msg) Monitor time between calls. long nextTime = System.currentTimeMillis(); long deltaTime = nextTime - time; if (performances) { System.out.println((msg.startsWith("*") ? "" : " | ") + msg + " in " + deltaTime + " ms."); time = nextTime; |
String | printTimeTakenMs(String msg, long start, long finish) print Time Taken Ms StringBuilder bldr = new StringBuilder(); bldr.append(msg).append(" Time taken: ").append((finish - start)).append(" milliseconds."); return bldr.toString(); |
Date | standardTime(Date date) standard Time Calendar c = new GregorianCalendar(); c.setTime(date); int minute = c.get(Calendar.MINUTE); int gewei = minute % 15; int shiwei = minute / 15 * 15; if (gewei >= 7) { gewei = 15; } else { ... |