Interfacing Arduino with LEDs and Analog Condenser Mic Input

I've been trying to figure out the ways to chip up my Clap Circuit with Arduino with more than 1 claps for different loads. For example, I have switched output pins; A0, A2 with LEDs and I wanted only one of them to switch back on with 2 claps and the other with a single clap. The problem of time delay is not no precise in the Arduino Analog Input with the condenser mic as The Serial monitor doesn't show the time delay and the operation of the LEDs with claps gets a little cringy. Is there a library file that I can use in my Arduino based Clap Switch.? What value of the parameter in the delay function is equal to 1 second.?

int ledPin = 4;
int soundPin = A0; 
int clapCount = 0;  

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT); 

}

void loop() {
  // put your main code here, to run repeatedly:
  int soundState = analogRead(soundPin);
  if (soundState > 13){

    clapCount++; 
    delay(500); //delay function parameter set to 500
  }
  if (clapCount ==4){
    digitalWrite(ledPin, LOW);
    Serial.println(soundPin); 
    clapCount = clapCount % 2; 
  }
  if (clapCount == 2){
    digitalWrite(ledPin, HIGH); 
    Serial.println(soundPin);
  }
   
}

Welcome and thank you for using code tags.

I can see that you struggle a little with English as well as code. Please try again to explain what you are trying to do. Please try to use short sentences and precise words. Also please include a schematic diagram and links to the components you are using.