How to delay in Arduino?

In Arduino, “delay” usually means one of two things:
1) Simple blocking delay: delay() / delayMicroseconds()
Milliseconds
delay(1000); // waits 1000 ms = 1 second
Microseconds
delayMicroseconds(200); // waits 200 µs
Notes
delay()blocks: nothing else inloop()runs during that time.delayMicroseconds()is for short delays (timing pulses), not long waits.
2) Non-blocking delay (recommended for real projects): millis()
Use this when you want to “wait” but still do other work (read sensors, handle buttons, serial, etc.).
Example: blink without stopping the program
const int LED = 13;
unsigned long last = 0;
const unsigned long interval = 1000; // ms
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
unsigned long now = millis();
if (now - last >= interval) {
last = now;
digitalWrite(LED, !digitalRead(LED));
}
// other code can run here while waiting
}
Quick rule
One simple pause → use
delay()Anything interactive / multiple tasks → use
millis()timing



