Timestamp
Gets Profiler timestamp.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Property
- Namespace: Unity.Profiling.LowLevel.Unsafe
- Assembly: UnityEngine.CoreModule
public static long Timestamp { get; }
Remarks
Use to measure time intervals with the same accuracy as Unity Profiler.
Examples
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; }}