Version: 2022.3
言語: 日本語
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; } }