Issues with using serial.avaliable to start a loop

if (Serial.available() > 0){
   char recentChar = Serial.read();
   if (recentChar == 's')
   {
     bool example = true;
    {
      if (currentTime - previousTime >= 2000 && example = true)
      {
        previousTime = currentTime;
        SerialMonitor();        
      }
     }
    }
   }