joelpedraza
12/07/2018, 7:05 PMandyb
12/07/2018, 7:29 PMrepeat(5) {
val time = measureTimeMillis {
....
}
println("Elapsed Time ${time}ms")
}
The repeats just ensure that you warmup
the JVM by loading classes etc so that you can ignore the 1st run and get an average of subsequent runs.Gerard Klijs
12/07/2018, 9:23 PMEdgars
12/07/2018, 9:28 PMfun main(args: Array<String>) = solve { Day7() }
and it prints out the time to initialize (if you preprocess some stuff to use for both parts), then averages 5 runs of each part and prints the result and time taken. (hmm, it also means that it include time taken to read the input file, meh, but it's noteworthy if the init time is unusually large)joelpedraza
12/07/2018, 9:49 PMGerard Klijs
12/07/2018, 9:51 PMjoelpedraza
12/07/2018, 10:00 PMjoelpedraza
12/07/2018, 10:00 PM