public int CopyTo (ProfilerRecorderSample* dest, int destSize, bool reset);

Parámetros

destPointer to the destination samples array.
destSizeDestination samples array size.
resetReset ProfilerRecorder.

Valor de retorno

int Returns the count of the copied elements.

Descripción

Copies collected samples to the destination array.

using Unity.Profiling;

public class ExampleScript { static double GetRecorderFrameAverage(ProfilerRecorder recorder) { var samplesCount = recorder.Capacity; if (samplesCount == 0) return 0;

double r = 0; unsafe { var samples = stackalloc ProfilerRecorderSample[samplesCount]; recorder.CopyTo(samples, samplesCount); for (var i = 0; i < samplesCount; ++i) r += samples[i].Value; r /= samplesCount; }

return r; } }

public void CopyTo (List<ProfilerRecorderSample> outSamples, bool reset);

Parámetros

outSamplesDestination list.
resetReset ProfilerRecorder.

Descripción

Copies all collected samples to the destination list.