Skip to content

Commit

Permalink
Update PhysicsTimer.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mag-nus committed Mar 24, 2024
1 parent d4f62be commit 19d60b6
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Source/ACE.Server/Physics/Common/PhysicsTimer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System;

using ACE.Server.Entity;

Expand All @@ -10,20 +10,19 @@ namespace ACE.Server.Physics.Common
/// </summary>
public class PhysicsTimer
{
private static readonly Stopwatch _timer;
// When using PhysicsTimer outside of a running ACE instance, you must uncomment these lines and use this version of the timer. Otherwise, your CurrentTime will not increment.
// You can use this method when running in an ACE instance, it's just less efficient.
/*private static readonly System.Diagnostics.Stopwatch _timer;
/*
/// <summary>
/// This should only be used by the ACE.Server.Physics namespace and physics related properties<para />
/// For a equally precise timer outside of this namespace, you can use WorldManager.PortalYearTicks
/// </summary>
public static double CurrentTime => _timer.Elapsed.TotalSeconds;
*/
public static double CurrentTime => Timers.PortalYearTicks;
static PhysicsTimer()
{
_timer = Stopwatch.StartNew();
}
_timer = System.Diagnostics.Stopwatch.StartNew();
}*/


// When using PhysicsTimer in a running ACE instance, you should use this timer instead. It is more efficient. Timers.PortalYearTicks is incremented by the WorldManager.
public static double CurrentTime => Timers.PortalYearTicks;
}
}

0 comments on commit 19d60b6

Please sign in to comment.