I am trying to write a code to measure the distance using a HC-SR04 module in C on my PI. I am struggling to measure the time taken in microseconds such as:
start_time = time_in_microseconds
*code*
end_time = time_in_microseconds
Any help would be much appreciated. Thanks