Answers for "java timing"

4

java get excectuon time

long startTime = System.nanoTime();
methodToTime();
long endTime = System.nanoTime();

long duration = (endTime - startTime);  //divide by 1000000 to get milliseconds.
Posted by: Guest on June-24-2020
0

java time

import java.time.LocalTime; // import the LocalTime class
...
// To display the current time (hour, minute, second, and nanoseconds)
LocalTime time = LocalTime.now();
System.out.println(time); // 11:04:57.416546
Posted by: Guest on June-22-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language