There is no such ‘break’ between the samples received so you may have to revert to the source_timestamp of the received samples.
It’s still not that easy as historical samples might be produced by different writers that use clocks that may not be sufficiently aligned.
Note however that (after wait_for_historical_data() is complete), the datareader’s history (of each instance) will be ordered, something that should prevent checking each/every sample.
Our advice would be not to rely on such a distinction and if time-validity is an issue, model that validity explicitly in the data model.
After calling wait_for_historical_data writers may still be producing new data during that the time in takes to complete. Can you tell the difference between historical samples and new samples (where the latter might be defined as “written since I called wait_for_historical_data”)?
Answer