Version: 2018.2
public static void EndSample ();

Description

Ends the current profiling sample.

The Profiler displays samples in its Hierarchy and Timeline views.

using UnityEngine;
using System.Collections;
using UnityEngine.Profiling;

public class ExampleClass : MonoBehaviour { void Example() { Profiler.BeginSample("MyPieceOfCode"); // Code to measure... Profiler.EndSample(); } }