Java Millisecond Convert toMilliseconds(long nanoseconds)

Here you can find the source of toMilliseconds(long nanoseconds)

Description

Converts nanoseconds to milliseconds

License

Open Source License

Parameter

Parameter Description
nanoseconds a parameter

Declaration

public static double toMilliseconds(long nanoseconds) 

Method Source Code

//package com.java2s;

public class Main {
    public static final double NANOSECONDS_PER_MILLISECONDS = 1000000, MILLISECONDS_PER_SECONDS = 1000,
            SECONDS_PER_HOUR = 3600;//from  w w w. java  2  s  . c  o m

    /**
     * Converts nanoseconds to milliseconds
     * @param nanoseconds
     */
    public static double toMilliseconds(long nanoseconds) {
        return toMilliseconds((double) nanoseconds);
    }

    /**
     * Converts nanoseconds to milliseconds
     * @param nanoseconds
     */
    public static double toMilliseconds(double nanoseconds) {
        return nanoseconds / NANOSECONDS_PER_MILLISECONDS;
    }
}

Related

  1. toMillis(int seconds)
  2. toMillis(int timeInSecs)
  3. toMillis(long nanos)
  4. toMilliSeconds(float t)
  5. toMilliseconds(long nanoSeconds)
  6. toMilliseconds(long second)
  7. toMilliseconds(long seconds, long nanos)
  8. toMilliseconds(Object value)
  9. toMillisFromNanos(long nanos)