Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Arduino is an IDE and the IDE is only partly responsible for speed.
and Arduino is a brand that sells microcontroler modules. Modules with different types of microcontrollers.
Each microcontroller has different specifications.Maybe hardware capture, maybe interrupt driven capture, maybe software capture.
Thus I recommend to find out what controller is used, then read it´s datasheet about the capture module (if exsts).
Also your software has a lot of influence on how fast an interrupt is processed. Count of variables used, code that prevents an ISR to be processed, how long your ISR takes to be processed....
So even if you give the exact microcontroller type and clock frequency there is a lot of unknown
If you want to be sure: Write your application and do some timing tests.
AVRs use counters for the capture of signals. It latches the counter_value on capture_event. So if you compare (difference) this value with the current_counter_value before you leave the ISR then you get a clue about max. possible capture rate)
Don´t expect someone to write code for you. If you want code, do an internet search or consider to pay for it.
Arduino framework runs hidenly over an RTOS system, so it is expected to face some intrinsic delay each time the loop() instance complete the cycle. As said above, Interrupt driven inputs are the suited way to ensure synch'ed reading.