diff --git a/Source/ACE.Server/Physics/Common/PhysicsTimer.cs b/Source/ACE.Server/Physics/Common/PhysicsTimer.cs index 9cdee9dd6e..b31925ff57 100644 --- a/Source/ACE.Server/Physics/Common/PhysicsTimer.cs +++ b/Source/ACE.Server/Physics/Common/PhysicsTimer.cs @@ -1,4 +1,6 @@ -using System.Diagnostics; +using System; + +using ACE.Server.Entity; namespace ACE.Server.Physics.Common { @@ -8,17 +10,19 @@ namespace ACE.Server.Physics.Common /// 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; - /// - /// This should only be used by the ACE.Server.Physics namespace and physics related properties - /// For a equally precise timer outside of this namespace, you can use WorldManager.PortalYearTicks - /// public static double CurrentTime => _timer.Elapsed.TotalSeconds; 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; } }