docs.unity3d.com
Search Results for

    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
    Assembly: Unity.Profiling.Core.dll
    Syntax
    public readonly struct ProfilerCounterValue<T> where T : unmanaged
    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 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
    [Conditional("ENABLE_PROFILER")]
    public void Sample()
    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)