Java Utililty Methods Time Print

List of utility methods to do Time Print

Description

The list of methods to do Time Print are organized into topic(s).

Method

StringprintTime(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;
voidprintTime(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 + "]");
StringprintTime(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);
...
voidprintTime(String msg)
print Time
System.out.println("Time: (" + System.currentTimeMillis() + ") " + msg);
voidprintTimer(String blah)
print Timer
System.out.println("TIMER: " + blah + (System.currentTimeMillis() - time));
time = System.currentTimeMillis();
voidprintTimes(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]));
voidprintTimestamp()
print Timestamp
long diff = System.currentTimeMillis() - LAST_TIMESTAMP;
resetTimestamp();
System.out.printf("TIME: %,11dms", new Long(diff));
voidprintTimeStamp(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;
StringprintTimeTakenMs(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();
DatestandardTime(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 {
...