(The first thing that comes to my mind would be to use an oscilloscope with two probes, one to each machine, but I’m guessing that’s not it.)
[1] If the clocks are synchronized, you can measure send time on one end, and receive time on the other. But synchronizing clocks involves estimating the time it takes for signals to pass im each direction, typically assuming each direction takes half the round trip.
Is this is with PCIe based Ethernet NICs? A single PCIe read probably takes at least a hundred nanos, right?
Maybe I could see it with something like a busy poll pingpong over RDMA/Infiniband, but that seems really low for “traditional” networking. It’s probably not possible to even send and receive a packet via loopback device that fast.