docs.unity3d.com
    Show / Hide Table of Contents

    Struct ProfilerCounterValue<T>

    Reports a value of an integral or floating point type to the Unity Profiler.

    Namespace: Unity.Profiling
    Syntax
    public readonly struct ProfilerCounterValue<T>
        where T : struct
    Type Parameters
    Name Description
    T

    int, uint, long, ulong, float or double type.

    Constructors

    ProfilerCounterValue(String)

    Constructs a ProfilerCounter that belongs to the generic ProfilerCategory.Scripts category. It is reported at the end of CPU frame to the Unity Profiler.

    Declaration
    public ProfilerCounterValue(string name)
    Parameters
    Type Name Description
    String name

    Name of ProfilerCounter.

    ProfilerCounterValue(String, ProfilerMarkerDataUnit)

    Constructs a ProfilerCounter that belongs to the generic ProfilerCategory.Scripts category. It is reported at the end of CPU frame to the Unity Profiler.

    Declaration
    public ProfilerCounterValue(string name, ProfilerMarkerDataUnit dataUnit)
    Parameters
    Type Name Description
    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    ProfilerCounterValue(String, ProfilerMarkerDataUnit, ProfilerCounterOptions)

    Constructs a ProfilerCounter that belongs to generic ProfilerCategory.Scripts category.

    Declaration
    public ProfilerCounterValue(string name, ProfilerMarkerDataUnit dataUnit, ProfilerCounterOptions counterOptions)
    Parameters
    Type Name Description
    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    ProfilerCounterOptions counterOptions

    ProfilerCounter options.

    ProfilerCounterValue(ProfilerCategory, String, ProfilerMarkerDataUnit)

    Constructs a ProfilerCounter that is reported at the end of CPU frame to the Unity Profiler.

    Declaration
    public ProfilerCounterValue(ProfilerCategory category, string name, ProfilerMarkerDataUnit dataUnit)
    Parameters
    Type Name Description
    ProfilerCategory category

    Profiler category.

    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    ProfilerCounterValue(ProfilerCategory, String, ProfilerMarkerDataUnit, ProfilerCounterOptions)

    Constructs a ProfilerCounter.

    Declaration
    public ProfilerCounterValue(ProfilerCategory category, string name, ProfilerMarkerDataUnit dataUnit, ProfilerCounterOptions counterOptions)
    Parameters
    Type Name Description
    ProfilerCategory category

    Profiler category.

    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    ProfilerCounterOptions counterOptions

    ProfilerCounter options.

    Properties

    Value

    Gets or sets value of the ProfilerCounter.

    Declaration
    public readonly T Value { get; set; }
    Property Value
    Type Description
    T
    Remarks

    Returns 0 and is not implemented in Release Players.

    Methods

    Sample()

    Sends the value to Unity Profiler immediately.

    Declaration
    public readonly void Sample()
    In This Article
    • Constructors
      • ProfilerCounterValue(String)
      • ProfilerCounterValue(String, ProfilerMarkerDataUnit)
      • ProfilerCounterValue(String, ProfilerMarkerDataUnit, ProfilerCounterOptions)
      • ProfilerCounterValue(ProfilerCategory, String, ProfilerMarkerDataUnit)
      • ProfilerCounterValue(ProfilerCategory, String, ProfilerMarkerDataUnit, ProfilerCounterOptions)
    • Properties
      • Value
    • Methods
      • Sample()
    Back to top
    Terms of use
    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