1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 22:56:30 +09:00

Fix for time issue 129; thanks to jujjyl

This commit is contained in:
lidgren
2012-08-23 12:55:12 +00:00
parent 29bd071d0d
commit b4b01aa52d
2 changed files with 4 additions and 2 deletions

View File

@@ -40,10 +40,12 @@ namespace Lidgren.Network
/// </summary>
public static double Now { get { return (double)(Stopwatch.GetTimestamp() - s_timeInitialized) * s_dInvFreq; } }
#else
private static readonly uint s_timeInitialized = (uint)Environment.TickCount;
/// <summary>
/// Get number of seconds since the application started
/// </summary>
public static double Now { get { return (double)Environment.TickCount / 1000.0; } }
public static double Now { get { return (double)((uint)Environment.TickCount - s_timeInitialized) / 1000.0; } }
#endif
/// <summary>