Java record the program execution time

w‮tual.ww‬turi.com
Java record the program execution time
// import java.time.*;
Instant start = Instant.now();
// do something

Instant end = Instant.now();
System.out.println("execution time in ms: " + Duration.between(start, end).toMillis());
Created Time:2017-09-04 22:49:33  Author:lautturi