There is a common function for Arduino called pulseIn() that you could use, however it isn't supported for the Galileo Board since the MCU architecture is different. The reason why I mentioned it is because you can write your own version of the function, so as first step I'd recommend you to see how the pulseIn() works. You can visit the Arduino page and search for the pulseIn() function to get more details about it.
Additionally, I'll recommend you to check these posts:
In the first post there is a discussion about the pulseIn() function and an user shared their own version of the pulseIn() function, so you could take that code as a base to write your own function version. In the second post there is a discussion about a pulse sensor that it could probably works similar to yours. However, the important thing I want you to check is the last reply, where another user shared their own custom code for pulse sensors. It might works for you.
I hope this information helps you with your project. Have a nice day!