# How to delay using millis()

**URL:** <https://forum.arduino.cc/t/how-to-delay-using-millis/1142938>\
**Category:** Programming\
**Created:** [June 29, 2023, 2:10pm UTC](https://forum.arduino.cc/t/how-to-delay-using-millis/1142938 "2023-06-29T14:10:15Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![StefanL38](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefanl38/32/713548_2.png) [@StefanL38](https://forum.arduino.cc/u/StefanL38)\
**Post date:** [June 29, 2023, 6:57pm UTC](https://forum.arduino.cc/t/how-to-delay-using-millis/1142938/16 "2023-06-29T18:57:10Z")

</div>

> [@thatchi](#):
>
> Thanks for that will get to the blink without delay in IDE and retry to understand it....

I don't recommend using the poor coded blink without delay() code in the Arduino-IDE-examples for the following reasons:

1. there is **no** explanation of the **fundamental difference** how non-blocking timing works. This leaves beginners confused if they try to see a delay()-thing in millis()
2. the code is poorly commented
3. variable names are confusing
4. It does **not** explain the principle with an easy to understand everyday example with explicit easy to understand numbers

I will **NEVER** get tired to post this again and again and again and again for the rest of my life until the point this blink without understand-example is replaced by a much better version (which will be the same as eternal)

I recommend to read this tutorial

> [@Example-code for timing based on millis() easier to understand through the use of example-numbers / avoiding delay()](https://forum.arduino.cc/t/example-code-for-timing-based-on-millis-easier-to-understand-through-the-use-of-example-numbers-avoiding-delay/974017/1):
>
> non-blocking timing. Execute code only from time to time. There are a lot of different ways to learn programming. This thread wants to add another approach that is different to the yet existing ones. UPDATE 06.01.2023 if you are mainly interested in applying non-blocking timing you can do a quick read of this short tutorial / demonstration If you are intersted in understanding the details how it works go on reading here. I use an everyday analogon in this post to explain the basic principle …

best regards Stefan

---

_[View the full topic](https://forum.arduino.cc/t/how-to-delay-using-millis/1142938)._
