Here you can find the source of end(String msg, long amount, Instant start)
public static Duration end(String msg, long amount, Instant start)
//package com.java2s; //License from project: Apache License import java.time.Duration; import java.time.Instant; public class Main { public static Duration end(String msg, long amount, Instant start) { Duration d = Duration.between(start, Instant.now()); System.out.println("PerformanceTest: " + msg); System.out.println("Total time needed: " + d.toMillis() / 1000d + " seconds for " + amount + " iterations"); System.out.println("That's " + d.toNanos() / (double) amount + "nanos per iteration"); return d; }// w w w . j a v a 2 s .c o m }