Declare global variable to keep track of the time that the switch has remained in it's position.
Record the edge time for when the switch changed states.
Keep checking for the the time it's been since it's been switched (millis() - timeSwitched) and compare that to your interval time.