# Prevent pause during FOR loops?

**URL:** <https://discourse.processing.org/t/prevent-pause-during-for-loops/16735>\
**Category:** Coding Questions\
**Created:** [December 30, 2019, 5:13pm UTC](https://discourse.processing.org/t/prevent-pause-during-for-loops/16735 "2019-12-30T17:13:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jetjaguar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jetjaguar/32/1370_2.png) [@jetjaguar](https://discourse.processing.org/u/jetjaguar)\
**Post date:** [December 30, 2019, 5:13pm UTC](https://discourse.processing.org/t/prevent-pause-during-for-loops/16735/1 "2019-12-30T17:13:45Z")

</div>

Hello everyone.

I am using FOR loops to load CSV datasets from URLs in the draw whenever the end user wants the data loaded. It takes the program about 5 seconds to load/parse/display the data during which time the sketch pauses all activity. I would like to show an animated loading message but cannot due to the pause in the draw.

I cannot preload the CSV files because there are many and they are updated reguraly on another server.

Any ideas?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![GSA\_IxD](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gsa_ixd/32/7554_2.png) [@GSA\_IxD](https://discourse.processing.org/u/GSA_IxD)\
**Post date:** [December 30, 2019, 7:39pm UTC](https://discourse.processing.org/t/prevent-pause-during-for-loops/16735/2 "2019-12-30T19:39:12Z")

</div>

Take a look at the thread() function  
[https://processing.org/reference/thread\_.html](https://processing.org/reference/thread_.html)

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [December 30, 2019, 8:14pm UTC](https://discourse.processing.org/t/prevent-pause-during-for-loops/16735/3 "2019-12-30T20:14:27Z")

</div>

Another relevant post: [Progress bar from inside draw()](https://discourse.processing.org/t/progress-bar-from-inside-draw/12091/5)

Kf

---

<div class="post-metadata">

**Author:** ![jetjaguar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jetjaguar/32/1370_2.png) [@jetjaguar](https://discourse.processing.org/u/jetjaguar)\
**Post date:** [December 31, 2019, 10:13pm UTC](https://discourse.processing.org/t/prevent-pause-during-for-loops/16735/4 "2019-12-31T22:13:42Z")

</div>

Perfect, thank you! It worked and sped up the process grealty.
