Java Second Format elapsedSeconds(long startTime)

Here you can find the source of elapsedSeconds(long startTime)

Description

Get the elapsed time in seconds.

License

Open Source License

Parameter

Parameter Description
startTime a parameter

Declaration

public static double elapsedSeconds(long startTime) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*  ww w  .  j ava  2  s. c  o  m*/
     * Get the elapsed time in seconds.
     * 
     * @param startTime
     * @return
     */
    public static double elapsedSeconds(long startTime) {
        return elapsedTime(startTime, System.nanoTime(), 1e9);
    }

    private static double elapsedTime(long startTime, long endTime, double units) {
        return (endTime - startTime) / units;
    }
}

Related

  1. _toSeconds(String strTime)
  2. addSecondCa(String d1, int timeSpan, String format)
  3. calculateTimeInSeconds(long startTimeInMilliseconds, long endTimeInMilliseconds)
  4. changeSecondsToTime(long seconds)
  5. compareDate(String fistDate, String secondDate, String format)
  6. elapsedSeconds2(long milli)
  7. formatMiliSeconds(long time)
  8. formatMilliIntervalAsSeconds(long interval)
  9. formatMinutesSeconds(final long sourceDuration, final TimeUnit sourceUnit)