# The millis seems can not reach the function?

**URL:** <https://forum.arduino.cc/t/the-millis-seems-can-not-reach-the-function/979946>\
**Category:** Programming\
**Created:** [April 11, 2022, 9:17pm UTC](https://forum.arduino.cc/t/the-millis-seems-can-not-reach-the-function/979946 "2022-04-11T21:17:39Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [April 12, 2022, 10:39am UTC](https://forum.arduino.cc/t/the-millis-seems-can-not-reach-the-function/979946/9 "2022-04-12T10:39:17Z")

</div>

There is a **fundamental** difference between using delay() and non-blocking timing which is the base to enable doing multiple things at the same time

If you want to use non-blocking timing the basic requirements are

- doing **all** timing non-blocking consequently: Delete **ALL** delay()s and **replace** them with non-blocking timing

- no for-loops, no while-loops

- ALL looping **MUST** be done by

## function loop()

After reading this I guess you have just a big questionmark inside your head.  
How shall I do this ????????????????????????

Yes you are right:  
this requires a **fundamental** restructuring of your code

You can try applying this immidiately to your code.  
But I promise you: **trying** to be fast by applying it **direct** to your code will end up in slowing you down needing three times **longer** to make it run

than

learning the basics about non-blocking timing and **after** learning the basics applying it to your code.

This learning the basics can be based on your project "RC-car" but building it up from scratch with adding only

## one thing at a time

I suggest that - as the first thing you take servo looking left / right and write a **small** demo-code that does **only** turning the servo left/right based on non-blocking timing.  
as a

## first attempt on your own

I'm pretty sure that you will have questions. Asking all those questions is the right deepness to really understand the code.

As a first introduction  
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):
>
> 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 …

Be the change you want to see in the world  
best regards Stefan

---

_[View the full topic](https://forum.arduino.cc/t/the-millis-seems-can-not-reach-the-function/979946)._
