Table of Contents

Measure It!


Measure It! is a small C# script we use while developing in Unity. It stores various statistics and displays them on screen whether in playmode or in editor. This is especially useful for Unity Indie users who don't have access to the profiler of the Pro version.


  1. Measure execution times in various units (Ticks, Milliseconds, Seconds) and show Min/Max/Average values
  2. Display variables and custom text
  3. Counting
  4. Console logging
  5. Toggle console output using debug groups


Measure It! stores information in slots. A case-sensitive string (slotName) is used to create and refer to slots and to display slot's values.

Profiling example

MeasureIt.Begin("Calculation time");
//do some stuff
Measureit.End("Calculation time");

Counting example

Displaying custom text example
MeasureIt.Set("Current event",Event.current);

Clear a slot

MeasureIt.Clear("Click"); // clear a single slot
MeasureIt.Clear(); // clear all slots

Console Log

MeasureIt.Log("Hello world","aCustomDebugGroup"); // only shown if aCustomDebugGroup isn't muted!

Working with Groups

MeasureIt.MuteGroup("aCustomDebugGroup"); // mute all debug output for aCustomDebugGroup
MeasureIt.UnMuteAllGroups(); // Clear list of muted Objects


using UnityEngine;
using System.Collections;

public class ClickToMove : MonoBehaviour {

    void Update()
        if (Input.GetMouseButtonUp(0)) {
            MeasureIt.End("Time between Clicks (s)");
            MeasureIt.Begin("Time between Clicks (s)");
            Ray r = Camera.main.ScreenPointToRay(Input.mousePosition);
            transform.position = r.GetPoint(-Camera.main.transform.position.z);
        transform.Translate(new Vector3(10,10,10)*Time.deltaTime);

    void OnGUI() 
        if (GUILayout.Button("Clear Time"))
            MeasureIt.Clear("Time between Clicks");
        if (GUILayout.Button("Clear Counter"))
        if (GUILayout.Button("Clear all"))
        GUILayout.Label("Resolution (nanoseconds): " + MeasureIt.ResolutionNs);
        if (MeasureIt.IsHighResolutionTimer)

        MeasureIt.Set("Cursor", Event.current.mousePosition);
Last modified: 2018/01/01 16:59 by Jake