Write to file inside the jenkins repository?

A part of our tests measures the time it takes for elements to load or actions to be done on the site. The times are printed into an text file so far to see if a ‘loading time’ was too high after changes were done.

These tests are now executed in jenkins.
Instead of having the ‘loading times’ in the jenkins console output, I would like to write them into a file in the jenkins repository, so that the data from all hourly runs can be seen at once and compared easily (example below).

So far I used PrintWriter that generated a file inside of the Katalon project, but does not function now anymore.

PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter('file.txt', true)))

I appreciate any idea or tip