/* * BooleanSupplier. Supplier of boolean-valued results. * IntSupplier. Supplier of int-valued results. * LongSupplier. Supplier of long-valued results. * DoubleSupplier. Supplier of double-valued results. */ public static void main(String[] args) { BooleanSupplier booleanSupplier = () -> Boolean.TRUE; IntSupplier intSupplier = () -> new Integer(0); LongSupplier longSupplier = () -> new Long(0); DoubleSupplier doubleSupplier = () -> new Double(0); System.out.println(booleanSupplier.getAsBoolean()); System.out.println(intSupplier.getAsInt()); System.out.println(longSupplier.getAsLong()); System.out.println(doubleSupplier.getAsDouble()); }
/** Stop the stopwatch, the resolution time is fixed. */ public void stopStopwatch() { timeCount = currentNanoTime.getAsLong(); currentNanoTime = () -> timeCount; }
@Override public long getTimeCountInNanoSeconds() { timeCount = currentNanoTime.getAsLong(); return super.getTimeCountInNanoSeconds(); }