Do something only if the sensor is low for more than 1 second

Something like this. All time elements are unsigned long

if (Sensor_status == LOW && waiting == 0){
endTime = millis(); // capture the time
waiting = 1;
}
elapsedTime = millis() - endTime; // time since started= currentTime - earlierTime
if (waiting == 1 && elapsedTime >=1000){
// read the sensor again
...
// still low?
if (Sensor_status == LOW){
  waiting = 0;
  // turn on the LED
  }
  else {
  waiting = 0;
  // do not turn on LED 
  }
}