debounce question: introduce delayed action

        if (ledState == HIGH) {

unsigned long startTime = millis();
        }

This creates a new variable called startTime which is local to just this block. Anywhere outside this block, you can never see this value.

Removed the "unsigned long " here.