Having problem using saveTable() in void draw()

I am using the dist() function on collision between two objects and I want to record the data after every collision but when I use saveTable() in void draw() my program starts to hangs.
When I used a timer and saved the table every 10 secounds this problem did not happen
Is there any other way that I can use saveTable at every collision between the objects? or is there any different way to do this.
Regards,

saveTable is time consuming because it uses the hard drive and draw() runs 60 times per second.

Can you store your data in a String array and save this every 10 seconds only?

Or look at createWriter in the reference

Can createWriter be used to make a .csv file or a table?