Version: 2020.2
언어: 한국어
public static long Timestamp ;

설명

Gets Profiler timestamp.

Use to measure time intervals with the same accuracy as 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; } }