Java Millisecond Convert toMillis(long nanos)

Here you can find the source of toMillis(long nanos)

Description

Convert the specified number of nanoseconds to number of milliseconds, ignoring the fractional part of the result.

License

Apache License

Parameter

Parameter Description
nanos the number of nanoseconds

Return

the number of milliseconds

Declaration

public static final long toMillis(long nanos) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static final long NS_TO_MS = 1000 * 1000;

    /**//from   www.j av  a2  s  .  co  m
     * Convert the specified number of nanoseconds to number of milliseconds, ignoring the fractional part of the
     * result.
     * <p>
     * @param nanos the number of nanoseconds
     * @return the number of milliseconds
     */
    public static final long toMillis(long nanos) {
        return nanos / NS_TO_MS;
    }
}

Related

  1. millisToTimeSpan(long millis)
  2. MillisToTimeString(long millis)
  3. millisToWords(long millis)
  4. toMillis(int seconds)
  5. toMillis(int timeInSecs)
  6. toMilliSeconds(float t)
  7. toMilliseconds(long nanoSeconds)
  8. toMilliseconds(long nanoseconds)
  9. toMilliseconds(long second)