Skip to content

Instantly share code, notes, and snippets.

@Split82
Created January 7, 2019 15:17
Show Gist options
  • Save Split82/fc4d1226b81edd4f9740e377e70c5061 to your computer and use it in GitHub Desktop.
Save Split82/fc4d1226b81edd4f9740e377e70c5061 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EventCallPerformanceTest : MonoBehaviour {
private System.Diagnostics.Stopwatch _stopwatch;
void Start () {
_stopwatch = new System.Diagnostics.Stopwatch();
_stopwatch.Restart();
Debug.Log(_stopwatch.Elapsed.TotalMilliseconds);
_stopwatch.Stop();
_stopwatch.Restart();
Debug.Log(_stopwatch.Elapsed.TotalMilliseconds);
_stopwatch.Stop();
_stopwatch.Restart();
EmptyMethod();
Debug.Log(_stopwatch.Elapsed.TotalMilliseconds);
_stopwatch.Stop();
_stopwatch.Restart();
EmptyMethod();
Debug.Log(_stopwatch.Elapsed.TotalMilliseconds);
_stopwatch.Stop();
_stopwatch.Restart();
EmptyMethod();
Debug.Log(_stopwatch.Elapsed.TotalMilliseconds);
_stopwatch.Stop();
}
private void EmptyMethod() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment