mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
perf: NetworkTime.localTime inlined
This commit is contained in:
parent
45e1afc812
commit
18170d16b8
@ -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
|
||||
|
||||
/// <summary>Returns double precision clock time _in this system_, unaffected by the network.</summary>
|
||||
#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.
|
||||
|
Loading…
Reference in New Issue
Block a user