Need help on how to get data from ultrasonic sensor by using virtual pin

First of all, DO NOT RUN THIS CODE! it will flood the Blynk server with far too many Blynk.virtualWrites per second.

Start by reading this:

https://docs.blynk.io/en/legacy-platform/legacy-articles/keep-your-void-loop-clean

Pete.