Java Nano Second Convert durationInSeconds(long startNano)

Here you can find the source of durationInSeconds(long startNano)

Description

Returns the duration in second between the specified nano time and now.

License

Apache License

Declaration

public static float durationInSeconds(long startNano) 

Method Source Code

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

public class Main {
    /**//w w w. j a v a2 s. c  om
     * Returns the duration in second between the specified nano time and now.
     */
    public static float durationInSeconds(long startNano) {
        final long endNano = System.nanoTime();
        final long durationMillis = (endNano - startNano) / 1000000;
        final float duration = durationMillis / 1000f;
        return duration;
    }
}

Related

  1. appendSecondsToDurationString(final StringBuilder sb, final long seconds, final long nanoseconds)
  2. asNanoSeconds(long seconds)
  3. doubleToNanoseconds(double d)
  4. humanReadableNanoseconds(long delta)
  5. microSecondToStr(int nanos, int meta)
  6. nano()
  7. nano2milli(double nano)