Advertisement
Hazkin

Untitled

Sep 10th, 2021
1,209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Diagnostics;
  3. public class NewBehaviourScript : MonoBehaviour
  4. {
  5.     private Stopwatch sw;
  6.     private void Start()
  7.     {
  8.         sw = new Stopwatch();
  9.         sw.Start();
  10.         UnityEngine.Debug.Log($"[{Time.frameCount}] Start: {sw.ElapsedMilliseconds}");
  11.         InvokeRepeating("Repeater", 0.0001f, 0.005f);
  12.     }
  13.  
  14.     private void Repeater()
  15.     {
  16.         UnityEngine.Debug.Log($"[{Time.frameCount}] Repeater: {sw.ElapsedMilliseconds}");
  17.     }
  18.  
  19.     private void Update()
  20.     {
  21.         UnityEngine.Debug.Log($"[{Time.frameCount}] Update: {sw.ElapsedMilliseconds}");
  22.     }
  23.  
  24.     private void LateUpdate()
  25.     {
  26.         UnityEngine.Debug.Log($"[{Time.frameCount}] LateUpdate: {sw.ElapsedMilliseconds}");
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement