diff --git a/Assets/Mirror/Runtime/NetworkTime.cs b/Assets/Mirror/Runtime/NetworkTime.cs index ff8f19340..337c6c0bf 100644 --- a/Assets/Mirror/Runtime/NetworkTime.cs +++ b/Assets/Mirror/Runtime/NetworkTime.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.CompilerServices; using UnityEngine; #if !UNITY_2020_3_OR_NEWER using Stopwatch = System.Diagnostics.Stopwatch; @@ -26,7 +27,11 @@ public static class NetworkTime /// Returns double precision clock time _in this system_, unaffected by the network. #if UNITY_2020_3_OR_NEWER - public static double localTime => Time.timeAsDouble; + public static double localTime + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => Time.timeAsDouble; + } #else // need stopwatch for older Unity versions, but it's quite slow. // CAREFUL: unlike Time.time, this is not a FRAME time.