getLastTimestampByName method
Returns the timestamp of the last sample of data the client receieved for the given topic
.
This is only the value of the last timestamp that the client has received from the server, so
if there is no subscription with the same name as the given topic
, it will
return either an old timestamp, or null.
Implementation
DateTime? getLastTimestampByName(String topic) {
if (!_lastAnnouncedTimestamps.containsKey(topic)) {
return null;
}
return DateTime.fromMicrosecondsSinceEpoch(
_lastAnnouncedTimestamps[topic]!);
}