How to get readings on serial monitor in every 10s?
There is one fundamental error with your code that I feel I should point out - one that I see time and time again.

The basic structure of your code is:


Forever:


Send a ping
Wait for the pong
Print the result
Delay for 100ms (or whatever time you choose)



And you expect to get a result every (delay) milliseconds.

However, you won't.  What you will actually get is a result every so often, where that time is defined as 100ms + the time to send and receive a ping.

So if it takes 11.6ms (200cm, the limit of most pin sensors) to receive the pong, then you also delay for 100ms, you're going to end up with 111.6ms between each print. It's even worse if the pong never arrives back - then pulseIn() will wait for up to a second before returning. You can, of course, reduce that to say 15ms by adding the timeout parameter as per the manual

When you reduce your printing delay to just 10ms you actually run the risk of delaying for more than double the time you expect to (21.6ms instead of 10ms).

Instead you need to use millis() to check to see if it is time to print something so that it doesn't matter how long the pong took to arrive, as long as that never exceeds the amount of time you want between prints, otherwise it's going to get delayed regardless.