# Known issue: long delays or blocking code kills the connection to the Cloud

**URL:** <https://community.particle.io/t/known-issue-long-delays-or-blocking-code-kills-the-connection-to-the-cloud/950>\
**Category:** Troubleshooting\
**Created:** [December 23, 2013, 2:17pm UTC](https://community.particle.io/t/known-issue-long-delays-or-blocking-code-kills-the-connection-to-the-cloud/950 "2013-12-23T14:17:17Z")\
**Posts on this page:** 1\
**Showing post:** 36

<div class="post-metadata">

**Author:** ![zach](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/zach/32/20714_2.png) [@zach](https://community.particle.io/u/zach)\
**Post date:** [January 27, 2015, 12:12am UTC](https://community.particle.io/t/known-issue-long-delays-or-blocking-code-kills-the-connection-to-the-cloud/950/36 "2015-01-27T00:12:38Z")

</div>

That’s true, our answers said the same thing, although they were worded differently. Basically:

1. It’s ok to use long `delay()`s because in recent versions of the firmware, `delay()` calls a background task that services the Wi-Fi module’s connection to the cloud
2. Passive delays by counting `millis()` is better practice
3. Code that blocks without calling Spark’s background task (like `while(1){}`) will still kill the connection

Does that help clear things up?

---

_[View the full topic](https://community.particle.io/t/known-issue-long-delays-or-blocking-code-kills-the-connection-to-the-cloud/950)._
