I have a Java application that I’ve been working on and I just realized that the program has to return a value in less than a minute, but don’t know how to find or display the time taken to run the program. How to find time taken to run a program?
Share
You can compare times using
System.nanoTime(). It will return the time in nanoseconds.You could use it like this:
Usefull links:
System.nanoTime()