I have a FSR sensor, where I need to ensure that it has a pressing value of at least 250 in 7 seconds. The values are not important, but needs to be above 250 in 7 seconds in order to run an other function.
I've found that the best way to code "Has condition been true for at least 'time'?" is to restart a millis() timer every time the condition is false. Then if the timer reaches 'time' the condition has been true that long.
const byte FSRPin = A0;
const unsigned long SevenSeconds = 7000;
void setup() {}
unsigned long TimerStart;
void loop()
{
 int reading = analogRead(FSRPin);
 if (reading <= 250)
  TimerStart = millis();
 if (millis() - TimerStart >= SevenSeconds)
 {
  // reading has been above 250 for 7 seconds or more
  do_the_thing();
  // Don't do it again unless the reading is high for
  // ANOTHER 7 seconds
  TimerStart = millis();
 }
}
void do_the_thing() {}