Measuring Pulse Width

@Robtillaart

Thank you so much for helping me out here but actually your code is giving me similar results as I was getting before the problem is that I have to measure the pulse widths between 10 to 15 microseconds accurately but your code as well as my code gives 8 or 12 microsecond for a 10 microsecond width input pulse and similarly it gives either 12 or 16 for pulse widths between 12 and 16 so that is the problem which I have been facing. The counter takes about 4 microsecond so is there any way to improve from this?

Thanks again