docs.unity3d.com
    Show / Hide Table of Contents

    Class Measure

    Enables measuring of performance metrics during a performance test.

    Inheritance
    Object
    Measure
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.PerformanceTesting
    Syntax
    public static class Measure

    Methods

    Custom(String, Double)

    Saves provided value as a performance measurement.

    Declaration
    public static void Custom(string name, double value)
    Parameters
    Type Name Description
    String name

    The name of the sample group to save the value to.

    Double value

    Value to be saved.

    Custom(SampleGroup, Double)

    Saves provided value as a performance measurement.

    Declaration
    public static void Custom(SampleGroup sampleGroup, double value)
    Parameters
    Type Name Description
    SampleGroup sampleGroup

    The sample group to save the value to.

    Double value

    Value to be saved.

    Frames()

    Measures frame times with given parameters.

    Declaration
    public static FramesMeasurement Frames()
    Returns
    Type Description
    FramesMeasurement

    FramesMeasurement using a builder pattern to provide parameters. Call Run() method to start measurement.

    Method(Action)

    Measures execution time for a method with given parameters.

    Declaration
    public static MethodMeasurement Method(Action action)
    Parameters
    Type Name Description
    Action action
    Returns
    Type Description
    MethodMeasurement

    MethodMeasurementusing a builder pattern to provide parameters. Call to start measurement.

    ProfilerMarkers(String[])

    Measures profiler markers for the given scope.

    Declaration
    public static ProfilerMeasurement ProfilerMarkers(params string[] profilerMarkerLabels)
    Parameters
    Type Name Description
    String[] profilerMarkerLabels

    List of profiler marker names.

    Returns
    Type Description
    ProfilerMeasurement

    ProfilerMarkers(SampleGroup[])

    Measures profiler markers for the given scope.

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

    List of SampleGroups where the name matches the profiler marker to measure.

    Returns
    Type Description
    ProfilerMeasurement

    Scope(String)

    Measures execution time for the given scope as a single time.

    Declaration
    public static ScopeMeasurement Scope(string name = "Time")
    Parameters
    Type Name Description
    String name

    Name to use for the sample group.

    Returns
    Type Description
    ScopeMeasurement

    IDisposable ScopeMeasurement on which you should call the Dispose() method to stop measurement.

    Scope(SampleGroup)

    Measures execution time for the given scope as a single time.

    Declaration
    public static ScopeMeasurement Scope(SampleGroup sampleGroup)
    Parameters
    Type Name Description
    SampleGroup sampleGroup

    Sample group to use to save samples to.

    Returns
    Type Description
    ScopeMeasurement

    IDisposable ScopeMeasurement on which you should call the Dispose() method to stop measurement.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023