problem with receive SMS

I dont want to show all the code and i dont think is necessary

check the commend :stuck_out_tongue:

unsigned long duration;
int pin=4;

voide setup
{
pinMode(pin,INPUT); 
}
void loop() 
{
  receiveSMS();                                                //
  duration=pulseIn(pin,HIGH);                   // i think : when i send SMS from my phone and loop running this row lose the SMS becauase need time to find the value 
  wind=96000/duration+1;      
}
                   
}
void receiveSMS()                          
 {                   
  if(SIM900.available() >0)
  {
    inchar=SIM900.read();                   
    if (inchar=='#')
    {
      delay(10);
      inchar=SIM900.read(); 
      if (inchar=='i')
      {
        delay(10);
        inchar=SIM900.read();
        if (inchar=='n')
        {
          delay(10);
          inchar=SIM900.read();
          if (inchar=='f')
          {
          delay(10);
          inchar=SIM900.read();
          if (inchar=='o')
        delay(10);
          }
          Serial.println("receiveSMS has been read");
          SIM900.println("AT+CMGD=1,4");               
          sendSMS();                                    
    }
   }
  }
 }
}
void send sms();
{}