First of all, thanks for taking time to read this. The code is written and executed as a JUnit test, so I dont know whether that affects the answer.
@Test
public void generate___() {
long startTime = System.nanoTime();
for (File file : getResultsFromFolder("C:\\temp\\....")) {
class runnableClass implements Runnable{
public void run() {
// do something with file
}
}
new runnableClass().run();
}
long endTime = System.nanoTime();
System.out.println("total took: " + (endTime - startTime) / 1000000); //divide by 1000000 to get milliseconds.
}