diff --git a/src/NmeaParser/Nmea/NmeaMessage.cs b/src/NmeaParser/Nmea/NmeaMessage.cs
index 9a634c1..4e2bbf9 100644
--- a/src/NmeaParser/Nmea/NmeaMessage.cs
+++ b/src/NmeaParser/Nmea/NmeaMessage.cs
@@ -65,6 +65,7 @@ namespace NmeaParser.Messages
{
MessageType = messageType;
MessageParts = messageParts;
+ Timestamp = System.Diagnostics.Stopwatch.GetTimestamp() * 1000d / System.Diagnostics.Stopwatch.Frequency;
}
static NmeaMessage()
@@ -294,5 +295,14 @@ namespace NmeaParser.Messages
}
return TimeSpan.Zero;
}
+
+ ///
+ /// Gets a relative timestamp in milliseconds indicating the time the message was created.
+ ///
+ ///
+ /// This value is deduced from System.Diagnostics.Stopwatch.GetTimestamp() * 1000d / System.Diagnostics.Stopwatch.Frequency.
+ /// You can use it to calculate the age of the message in seconds by calculating the difference between the timestamp and the above expression
+ ///
+ public double Timestamp { get; }
}
}
diff --git a/src/NmeaParser/NmeaParser.csproj b/src/NmeaParser/NmeaParser.csproj
index 2e49093..44bce08 100644
--- a/src/NmeaParser/NmeaParser.csproj
+++ b/src/NmeaParser/NmeaParser.csproj
@@ -24,7 +24,8 @@
Added IGeographicLocation interface to easily get any message that supports reporting a location.
Added GnssMonitor for simplifying monitoring location messages and reporting a location.
Added an NTRIP client for getting RTCM correctional messages from an NTRIP Server.
-Improved the buffered stream to more accurately emulate baud rates.
+Improved the buffered stream to more accurately emulate baud rates.
+All messages now have a unique timestamp useful to expire older messages.
true
true
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb