Class ProfilingSampler | Core RP Library | 7.2.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class ProfilingSampler

    Wrapper around CPU and GPU profiling samplers. Use this along ProfilingScope to profile a piece of code.

    Inheritance
    Object
    ProfilingSampler
    Namespace: UnityEngine.Rendering
    Syntax
    public class ProfilingSampler

    Constructors

    ProfilingSampler(String)

    Constructor.

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

    Name of the profiling sampler.

    Properties

    cpuElapsedTime

    CPU Elapsed time in milliseconds (Command Buffer execution).

    Declaration
    public float cpuElapsedTime { get; }
    Property Value
    Type Description
    Single

    cpuSampleCount

    Number of times the Profiling Sampler has hit on the CPU in the command buffer.

    Declaration
    public int cpuSampleCount { get; }
    Property Value
    Type Description
    Int32

    enableRecording

    Set to true to enable recording of profiling sampler timings.

    Declaration
    public bool enableRecording { set; }
    Property Value
    Type Description
    Boolean

    gpuElapsedTime

    GPU Elapsed time in milliseconds.

    Declaration
    public float gpuElapsedTime { get; }
    Property Value
    Type Description
    Single

    gpuSampleCount

    Number of times the Profiling Sampler has hit on the GPU

    Declaration
    public int gpuSampleCount { get; }
    Property Value
    Type Description
    Int32

    inlineCpuElapsedTime

    CPU Elapsed time in milliseconds (Direct execution).

    Declaration
    public float inlineCpuElapsedTime { get; }
    Property Value
    Type Description
    Single

    inlineCpuSampleCount

    Number of times the Profiling Sampler has hit on the CPU.

    Declaration
    public int inlineCpuSampleCount { get; }
    Property Value
    Type Description
    Int32

    name

    Name of the Profiling Sampler

    Declaration
    public string name { get; }
    Property Value
    Type Description
    String

    Methods

    Get<TEnum>(TEnum)

    Get the sampler for the corresponding enumeration value.

    Declaration
    public static ProfilingSampler Get<TEnum>(TEnum marker)
        where TEnum : Enum
    Parameters
    Type Name Description
    TEnum marker

    Enumeration value.

    Returns
    Type Description
    ProfilingSampler

    The profiling sampler for the given enumeration value.

    Type Parameters
    Name Description
    TEnum

    Type of the enumeration.

    In This Article
    • Constructors
      • ProfilingSampler(String)
    • Properties
      • cpuElapsedTime
      • cpuSampleCount
      • enableRecording
      • gpuElapsedTime
      • gpuSampleCount
      • inlineCpuElapsedTime
      • inlineCpuSampleCount
      • name
    • Methods
      • Get<TEnum>(TEnum)
    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