write output to file

printing to terminal/console is always a huge delay.
writing to file is faster and easier to manipulate later