Java Instant Create end(String msg, long amount, Instant start)

Here you can find the source of end(String msg, long amount, Instant start)

Description

end

License

Apache License

Declaration

public static Duration end(String msg, long amount, Instant start) 

Method Source Code

//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
}

Related

  1. convertDotNetTicksToInstant(long dotNetTicks)
  2. deserializeToInstant(String date)
  3. deserializeToInstant(String date)
  4. getEarliestInstant()
  5. getInstant(final Calendar calendar)
  6. getInstant(LocalDate localDate)
  7. getInstantOfEpoch(long seconds)