Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Profiler

Namespace: UnityEngine

Description

Controls the Profiler from script.

You can add custom Profiler sections in your scripts with Profiler.BeginSample and Profiler.EndSample.

In standalone games, Profiler can dump all profiling information using Profiler.logFile and Profiler.enabled.

Profiler is only available in Unity Pro.

Static Variables

enableBinaryLogSets profiler output file in built players.
enabledEnables the Profiler.
logFileSets profiler output file in built players.
usedHeapSizeHeap size used by the program.

Static Functions

AddFramesFromFileDisplays the recorded profiledata in the profiler.
BeginSampleBegin profiling a piece of code with a custom label.
EndSampleEnd profiling a piece of code with a custom label.
GetMonoHeapSizeReturns the size of the mono heap.
GetMonoUsedSizeReturns the used size from mono.
GetRuntimeMemorySizeReturns the runtime memory usage of the resource.