Button State

One way to do this is to record when then button is first pressed by saving the value returned from the millis() function. Each time through loop() check if the difference between current value of millis() and your saved value is bigger than 3000 (3 seconds). Once you have reached that you can then decide what to do.