docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class FramesMeasurement

    Allows measuring of frame times.

    Inheritance
    object
    FramesMeasurement
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.PerformanceTesting.Measurements
    Assembly: Unity.PerformanceTesting.dll
    Syntax
    public class FramesMeasurement

    Methods

    DontRecordFrametime()

    Specifies frame times should not be recorded.

    Declaration
    public FramesMeasurement DontRecordFrametime()
    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    DynamicMeasurementCount(double, ConfidenceLevel, OutlierMode)

    Dynamically find a suitable measurement count based on the margin of error of the samples. The measurements will stop once a certain amount of samples (specified by a confidence interval) falls within an acceptable error range from the result (defined by a relative error of the mean).

    Declaration
    public FramesMeasurement DynamicMeasurementCount(double maxRelativeError, ConfidenceLevel confidenceLevel = ConfidenceLevel.L99, OutlierMode outlierMode = OutlierMode.Remove)
    Parameters
    Type Name Description
    double maxRelativeError

    The maximum relative error of the mean that the margin of error must fall into.

    ConfidenceLevel confidenceLevel

    The confidence interval which will be used to calculate the margin of error.

    OutlierMode outlierMode

    Outlier mode allows to include or exclude outliers when evaluating the stop criterion.

    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    DynamicMeasurementCount(OutlierMode)

    Dynamically find a suitable measurement count based on the margin of error of the samples. The measurements will stop once a certain amount of samples (specified by a confidence interval) falls within an acceptable error range from the result (defined by a relative error of the mean). A default margin of error range of 2% and a default confidence interval of 99% will be used.

    Declaration
    public FramesMeasurement DynamicMeasurementCount(OutlierMode outlierMode = OutlierMode.Remove)
    Parameters
    Type Name Description
    OutlierMode outlierMode

    Outlier mode allows to include or exclude outliers when evaluating the stop criterion.

    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    MeasurementCount(int)

    Count of measurements to take.

    Declaration
    public FramesMeasurement MeasurementCount(int count)
    Parameters
    Type Name Description
    int count

    Count of measurements.

    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    ProfilerMarkers(params string[])

    Records provided profiler markers once per frame.

    Declaration
    public FramesMeasurement ProfilerMarkers(params string[] profilerMarkerNames)
    Parameters
    Type Name Description
    string[] profilerMarkerNames

    Profiler marker names as in profiler window.

    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    ProfilerMarkers(params SampleGroup[])

    Records provided profiler markers once per frame.

    Declaration
    public FramesMeasurement ProfilerMarkers(params SampleGroup[] sampleGroups)
    Parameters
    Type Name Description
    SampleGroup[] sampleGroups

    List of SampleGroups where a name matches the profiler marker and desired SampleUnit

    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    Run()

    Executes the frame time measurement with given parameters. When MeasurementCount is not provided, a probing method will run to determine desired measurement counts.

    Declaration
    public IEnumerator Run()
    Returns
    Type Description
    IEnumerator

    IEnumerator to yield until finish.

    SampleGroup(string)

    Overrides the name of default sample group "Time".

    Declaration
    public FramesMeasurement SampleGroup(string name)
    Parameters
    Type Name Description
    string name

    Name of the sample group.

    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    SampleGroup(SampleGroup)

    Overrides the default sample group "Time"

    Declaration
    public FramesMeasurement SampleGroup(SampleGroup sampleGroup)
    Parameters
    Type Name Description
    SampleGroup sampleGroup

    Sample group to use.

    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    Scope(string)

    Switches frame time measurement to asynchronous scope measurement.

    Declaration
    public FramesMeasurement.ScopedFrameTimeMeasurement Scope(string name = "Time")
    Parameters
    Type Name Description
    string name

    Sample group name.

    Returns
    Type Description
    FramesMeasurement.ScopedFrameTimeMeasurement

    A ScopedFrameTimeMeasurement instance configured according to the given arguments.

    Scope(SampleGroup)

    Switches frame time measurement to asynchronous scope measurement.

    Declaration
    public FramesMeasurement.ScopedFrameTimeMeasurement Scope(SampleGroup sampleGroup)
    Parameters
    Type Name Description
    SampleGroup sampleGroup

    Sample group to save measurements.

    Returns
    Type Description
    FramesMeasurement.ScopedFrameTimeMeasurement

    A ScopedFrameTimeMeasurement instance configured according to the given arguments.

    WarmupCount(int)

    Count of warmup executions.

    Declaration
    public FramesMeasurement WarmupCount(int count)
    Parameters
    Type Name Description
    int count

    Count of warmup executions.

    Returns
    Type Description
    FramesMeasurement

    An updated instance of the FramesMeasurement to be used in fluent syntax.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)