When trying to measure execution time I know that writing values to a file is much faster than printing values to the console (which can really slow the program down). But I haven't been able to find anything comparing the speed of writing values directly to a file vs. saving values in a growable data structure like a LinkedList during program execution and then writing all of the values to a file on program exit. It seems like saving values in a something like a LinkedList "might" be faster, but I don't know for sure.
I am trying to time an audio mixer loop running in its own thread, so it'll be self-timing. Therefore I'd like to use a technique for measuring and storing the times that makes as little impact on the overall run time as possible.
Also, I have looked at Java profilers like VisualVM, but haven't found a way to view execution times for individual passes through the loop.
Thanks!