Using Millis with optical encoder

Thanks UKHeliBob. I have it working now...

/*
 In this example, we're using optical encoder LPD3806-400BM.
 Only OUT-B (white wire) is used and connected to pin 2 on Arduino.
 This allows a count of up to 400 pulses only.
 Connecting both outputs will give a count of up to 800 pulses! 
 */
const int ledPin =  LED_BUILTIN;
unsigned long startTime;
int lastCounterReading = 0;
int ledState;
unsigned long interval = 200;

volatile long temp, counter = 0; //This variable will increase or decrease depending on the rotation of encoder
    
void setup() {
  Serial.begin (9600);
  pinMode(2, INPUT_PULLUP); // internal pullup input pin 2 
  pinMode(ledPin, OUTPUT);
  
   //Setting up interrupt
  //A rising pulse from encodenren activated ai0(). AttachInterrupt 0 is DigitalPin nr 2 on moust Arduino.
  attachInterrupt(0, ai0, RISING);
  }
   
  void loop() {
  // Send the value of counter
  if( counter != temp ){
  Serial.println (counter);
  temp = counter;
  }
   if (counter == 100) 
  {
    if (lastCounterReading != 100)
    {
      ledState = 1;
      startTime = millis();
    }
  }
  lastCounterReading = counter;
   if (ledState)
  {
    if (millis() - startTime <= interval)
    {
      digitalWrite(ledPin, HIGH);
    }
    else
    {
      digitalWrite(ledPin, LOW);
      ledState = 0;
    }
  }  
}
  
  void ai0() {
  // ai0 is activated if DigitalPin nr 2 is going from LOW to HIGH
  if(digitalRead(2)==LOW) {
  counter--;
   if (counter == 0)      
        counter = 400;
    }
    else {
      if (counter == 400)
        counter = 0;  
      counter++;
  }
  }
  
 

The only issue I have now is reading the encoder accurately. If I spin it too fast, Arduino misses 'pulse 100'. Should I use both the encoder's outputs? Would that make a difference? I could use possibly 95-100 as the trigger for the LED if needs be but I'm sure there's a better way as I'm only hand cranking the encoder. Usually these models can track a motor I think.