EMA C++ Performace Tools Guide : 3 Latency Measurement Details : 3.2 Latency
 
3.2 Latency
Latency is measured using timestamps embedded in the messages sent by each application. The receiving application compares this timestamp against the current time to determine the latency.
Each tool sends messages in bursts. To send timestamps, a message is randomly chosen from the message burst and the timestamp is embedded. When this message is received, the receiving application compares it to the current time to determine the latency.
Figure 7. Latency Instrument Codes within a Tick
Timestamps are high-resolution and non-decreasing. Because the source of this time varies across platforms and might not be synchronized between multiple machines, update and generic message latency measurements require that the provider and consumer run on the same machine. Posting latency measurements do not require this, as EmaCppConsPerf generates both sending and receiving timestamps.
 
NOTE: Open Message Model performance tool timestamp information contains the number of microseconds since an epoch.1

1 Windows uses QueryPerformanceCounter(), Linux uses clock_gettime() with the monotonic clock.

Figure 8. Timing Diagram for Latency Measurements
The standard latency measurement is initiated by the provider, which encodes a starting time into an update. This timestamp is included as a piece of data in the payload using a pre-determined latency Field IDentifier. On the consumer side, the application processes incoming updates and generic messages, decodes the payload, and looks for updates or generic messages which include the latency Field IDentifier (known as latency updates). After decoding a latency update or generic message, the consumer takes a second timestamp and compares the two, outputting the difference as the measured latency for that particular update or generic message.