Java Time Elapsed elapsed(long from, long required)

Here you can find the source of elapsed(long from, long required)

Description

Check if enough time has passed by from a certain moment.

License

Open Source License

Parameter

Parameter Description
from = certain moment
required = amount of required time

Return

true or false

Declaration

public static boolean elapsed(long from, long required) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//w  w  w.  j a  v a2  s  .c o m
     * Check if enough time has passed by from a certain moment.
     * @param from = certain moment
     * @param required = amount of required time
     * @return true or false
     */
    public static boolean elapsed(long from, long required) {
        return System.currentTimeMillis() - from > required;
    }
}

Related

  1. elapsed(long duration, long required)
  2. elapsed(long from, long to)
  3. elapsedMicros(String startTime, String endTime)
  4. elapsedNanos(long nanoseconds)
  5. elapsedNanos(long startNanoTime)