获取 Profiler 时间戳。
用于以与 Unity Profiler 相同的精度测量时间间隔。
using Unity.Profiling.LowLevel.Unsafe;
public class Example { public static long ElapsedNanoseconds(long startTimestamp) { long now = ProfilerUnsafeUtility.Timestamp; var conversionRatio = ProfilerUnsafeUtility.TimestampToNanosecondsConversionRatio; return (now - startTimestamp) * conversionRatio.Numerator / conversionRatio.Denominator; } }