Increase attachinterrupt function's sample rate

Hello Everyone,

First of all,If I open this topic wrong place sorry about this.

I am doing a final thesis about taking a clap signal from microphones using some triangulation technic to detect the source position. In my project I have precision problem.I researched it and I found that I have to increase sample rate with some thread .However I couldn't find the correct answer. I have to reach at least 1Mhz sampling rate.

To detect the time difference I am using attach interrupt function. Could you help me about How can I increase the sample rate.

Or Could you give me another solution to get time difference instead of attachinterrupt function. Maybe I can use analog part ?
Shortly,Could give me your exprience please,

I am looking forward your answers.

Sincerely,

To detect the time difference I am using attach interrupt function

No, you're not.
The attachInterrupt function merely vectors an interrupt to a function provided as one of its arguments.

I have to reach at least 1Mhz sampling rate.

I hope you're not going to tell us this is on a standard 8 bit Arduino.

Hello AWOL,

Thanks for reply, I am very newby for using arduino.

It's my code to get time from microphone;
void setup() {
Serial.begin(250000);

attachInterrupt(digitalPinToInterrupt(2),t1_calc,FALLING);
attachInterrupt(digitalPinToInterrupt(3),t2_calc,FALLING);
attachInterrupt(digitalPinToInterrupt(21),t3_calc,FALLING);
attachInterrupt(digitalPinToInterrupt(20),t4_calc,FALLING);

}
void t1_calc(){

time1=micros();

}
void t2_calc(){

time2=micros();

}
void t3_calc(){

time3=micros();

}
void t4_calc(){

time4=micros();
}

so you told me this function is not correct ? Could you give me some advice to detect time from the microphone ?

so you told me this function is not correct ?

It's the first time I've seen your code, so I can't have told you it's incorrect.
It doesn't look faulty, per se, but it doesn't do anything useful either.

It's missing code tags too.