ProfilerHarness Class

namespace Decnet.DeviceFit
public class ProfilerHarness : System.IDisposable

The ProfilerHarness manages low-overhead profiler recorders (ProfilerRecorder) and Unity’s FrameTimingManager. It is designed to sample frame metrics without allocating managed garbage on the hot path.


Properties

public bool SupportsGPUTiming { get; }

Returns true if FrameTimingManager GPU timestamps are available and supported by the active platform. In the Unity Editor, this property returns false.

public bool SupportsFrameTiming { get; }

Returns true if FrameTimingManager.IsFeatureEnabled() is active.


Methods

public void Initialize()

Starts internal profiler recorders for:

  • "CPU Main Thread Frame Time" (15 samples buffer)
  • "GC Allocated In Frame" (15 samples buffer)
  • "Total Used Memory" (1 sample buffer)
public RawFrameRecord SampleCurrentFrame(int frameIndex, string checkpointId, bool isWarmup)

Captures the current frame’s performance metrics into an unmanaged RawFrameRecord value struct. Guaranteed 0 bytes heap allocation on the calling thread.

public void Dispose()

Releases all active profiler recorders and cleans up internal buffers.


Copyright © 2026 Decnet Games. All rights reserved. DeviceFit is a commercial Unity Asset.

This site uses Just the Docs, a documentation theme for Jekyll.