Java TimeUnit Calculate timeSince(final long startNanos, final TimeUnit destUnit)

Here you can find the source of timeSince(final long startNanos, final TimeUnit destUnit)

Description

time Since

License

Apache License

Declaration

public static long timeSince(final long startNanos, final TimeUnit destUnit) 

Method Source Code


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

import java.util.concurrent.TimeUnit;

public class Main {
    public static long timeSince(final long startNanos, final TimeUnit destUnit) {
        return destUnit.convert(System.nanoTime() - startNanos, TimeUnit.NANOSECONDS);
    }/* w w  w  .jav  a  2  s .  co  m*/
}

Related

  1. sleep(TimeUnit unit, long length)
  2. sleepAndCachedInterruptedException(long sleepFor, TimeUnit unit)
  3. sleepFor(long period, TimeUnit timeUnit)
  4. timeDiff(Calendar end, Calendar begin, TimeUnit timeUnit)
  5. timeDiff(Date date1, Date date2, TimeUnit minutes)
  6. waitForEnd(Process process, long timeout, TimeUnit unit)