Lesson Template

Time Functions

Learn delay(), millis(), and timing without blocking.

Progress

8% completed

Lesson Overview

This lesson introduces the core ideas behind Time Functions.

  • delay()
  • millis()
  • Simple timers

Example Code

unsigned long now = millis();
if (now - lastBlink >= 500) {
  lastBlink = now;
}

Lessons in This Section

Lesson 15 - Using delay() for Basic Timing

Learn what delay() does, how millisecond timing works, and when delay() is useful for beginner sketches.

Open Lesson

Lesson 16 - Using delayMicroseconds() for Precise Delays

Learn microsecond-level delay timing for short pulses, fast signals, and precision-focused beginner examples.

Open Lesson

Lesson 17 - Using millis() for Non-Blocking Timing

Learn non-blocking timing with millis(), including elapsed-time checks, responsive loops, and overflow-safe patterns.

Open Lesson

Lesson 18 - Using micros() for Microsecond Timing

Learn micros()-based non-blocking microsecond timing, interval checks, and overflow-safe timing patterns.

Open Lesson