mirror of
https://github.com/dotMorten/NmeaParser.git
synced 2026-01-20 15:40:16 +01:00
Add timestamp to messages
This commit is contained in:
parent
8ef85c3283
commit
adad914582
|
|
@ -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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a relative timestamp in milliseconds indicating the time the message was created.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This value is deduced from <c>System.Diagnostics.Stopwatch.GetTimestamp() * 1000d / System.Diagnostics.Stopwatch.Frequency</c>.
|
||||
/// You can use it to calculate the age of the message in seconds by calculating the difference between the timestamp and the above expression
|
||||
/// </remarks>
|
||||
public double Timestamp { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.</PackageReleaseNotes>
|
||||
Improved the buffered stream to more accurately emulate baud rates.
|
||||
All messages now have a unique timestamp useful to expire older messages.</PackageReleaseNotes>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
|
|
|
|||
Loading…
Reference in a new issue