Java TimeUnit Usage secondsPassed(int startTime)

Here you can find the source of secondsPassed(int startTime)

Description

seconds Passed

License

Apache License

Declaration

public static int secondsPassed(int startTime) 

Method Source Code

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

import java.util.concurrent.TimeUnit;

public class Main {
    public static int secondsPassed(int startTime) {
        return getSecondsTimeStamp() - startTime;
    }/*from   w ww .  jav  a2  s . co  m*/

    public static int getSecondsTimeStamp() {
        return (int) TimeUnit.NANOSECONDS.toSeconds(System.nanoTime());
    }
}

Related

  1. roundTimestampToNexDay(long timestamp)
  2. run(Callable task, long timeout)
  3. second(long second)
  4. seconds(long timeInMillis)
  5. secondsFromNow(long seconds)
  6. secondsToETA(long secondsTotal)
  7. secondsToHMS(long seconds)
  8. secondsToMillis(int seconds)
  9. secondsToYearsDaysHoursMinutesSeconds(double seconds)