docs.unity3d.com
    Show / Hide Table of Contents

    Struct ProfilerCounter<T>

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

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

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

    Constructors

    ProfilerCounter(ProfilerCategory, String, ProfilerMarkerDataUnit)

    Constructs a ProfilerCounter that is reported to the Unity Profiler whenever you call Sample().

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

    Profiler category.

    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    Methods

    Sample(T)

    Sends the value to Unity Profiler immediately.

    Declaration
    public readonly void Sample(T value)
    Parameters
    Type Name Description
    T value

    The value to send to the profiler.

    Remarks

    Does nothing in Release Players.

    In This Article
    • Constructors
      • ProfilerCounter(ProfilerCategory, String, ProfilerMarkerDataUnit)
    • Methods
      • Sample(T)
    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