Run two Loops Simultaneously on Arduino
Basically you need to get rid of the delay and any other blocking loops. Here is a way to do it.

Define this variable globally.

unsigned long lastTime = 0;


Then in your first loop, add the following code either to the beginning or the end:

if (millis() - lastTime &gt;= 1000 || !lastTime) {
    lastTime = millis();
    tone(TICK_PIN,1000,2);
}