Here you can find the source of durationInSecs(long startNanos, long endNanos)
public static long durationInSecs(long startNanos, long endNanos)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.TimeUnit; public class Main { public static long durationInSecs(long startNanos, long endNanos) { return nanosToSecs(endNanos) - nanosToSecs(startNanos); }/*from w ww . j a va 2 s. c o m*/ public static long nanosToSecs(long nanos) { return TimeUnit.NANOSECONDS.toSeconds(nanos); } }