Identical source_timestamp through middleware

3 posts / 0 new
Last post
Offline
Last seen: 6 years 4 months ago
Joined: 07/10/2018
Posts: 2
Identical source_timestamp through middleware
Hi,
 
I am currently testing to latency of a middleware program. This program is subscribed and recieves a
sample from a custom publisher and a specific topic, which contains various primitive Java types. After
receiving a sample, the program alters the data to the user's choice (the middleware is already expecting a
sample that fits a certain object). Finally, the program sends the modified object off through its own
publisher to a custom subscriber.
 
pub -> middleware -> sub
 
When I compare the respective source_timestamps for the SampleInfos in the program's subscriber and in
the custom subscriber, the times are shown to be identical to the nanosecond. Is it possible that the
program is just that fast?
 
I have verified that the GUIDs are at least different, and that the timestamps do have a proper difference
between them when the program is set to sleep for a couple of milliseconds before publishing to the custom
subscriber. This test is running on the same machine, through UDPv4. The topic being sent is keyed.
 
Thanks,

Alex
Gerardo Pardo's picture
Offline
Last seen: 2 weeks 6 days ago
Joined: 06/02/2010
Posts: 602

Hi,

No it cannot be that fast. It would take more than 1 nanosecond for sure :)

What Operating System are you running on? What you are seeing could be caused by the clock resolution on that platform.

Maybe you can try a simple experiment: Write a loop calling DomainParticipant.get_current_time() and compare the results between calls and print the result each time you see some difference. That way we could get an idea of what the resolution of the clock is.

Gerardo

Offline
Last seen: 6 years 4 months ago
Joined: 07/10/2018
Posts: 2

Thanks for responding, Gerardo.
 
I am running on Windows 7 Enterprise. I tried out your experiment, and I was getting latencies that were either 14 ms and 15 ms, no in between, with the exception of fifteen 1 ms delays out of the one-thousand in my test.