# Having problem using saveTable() in void draw()

**URL:** <https://discourse.processing.org/t/having-problem-using-savetable-in-void-draw/19801>\
**Category:** Coding Questions\
**Created:** [April 15, 2020, 2:30pm UTC](https://discourse.processing.org/t/having-problem-using-savetable-in-void-draw/19801 "2020-04-15T14:30:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdullahmq](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@abdullahmq](https://discourse.processing.org/u/abdullahmq)\
**Post date:** [April 15, 2020, 2:30pm UTC](https://discourse.processing.org/t/having-problem-using-savetable-in-void-draw/19801/1 "2020-04-15T14:30:46Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [April 15, 2020, 2:37pm UTC](https://discourse.processing.org/t/having-problem-using-savetable-in-void-draw/19801/2 "2020-04-15T14:37:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![abdullahmq](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@abdullahmq](https://discourse.processing.org/u/abdullahmq)\
**Post date:** [April 15, 2020, 4:13pm UTC](https://discourse.processing.org/t/having-problem-using-savetable-in-void-draw/19801/3 "2020-04-15T16:13:25Z")

</div>

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