Java Time Format formatMili(long timeDelta)

Here you can find the source of formatMili(long timeDelta)

Description

format Mili

License

Open Source License

Declaration

public static String formatMili(long timeDelta) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String formatMili(long timeDelta) {
        if (timeDelta < 1000) {
            return "" + timeDelta + " miliseconds";
        } else if (timeDelta < 60000) {
            return "" + (double) timeDelta / 1000.0 + " seconds";
        } else if (timeDelta < 3600000) {
            return "" + (double) timeDelta / 60000.0 + " minutes";
        } else {/*  w  w  w .jav a2s .c o m*/
            return "" + (double) timeDelta / 3600000.0 + " hours";
        }
    }
}

Related

  1. formatExecutionTime(long executionTime)
  2. formatExecutionTime(long ms)
  3. formatInformalTime(final String minuteRoundedName, final String minuteRoundingToken, final String informalHourName)
  4. formatMeasures(final int quartersPerMeasure, final double time, final int startOffset)
  5. formatMicroSpan(long time)
  6. formatMs(long elapsedTime)
  7. formatMusicTime(int time)
  8. formatNanosec(long timeNanosec)
  9. formatPeroid(long time)