Skip to content

Instantly share code, notes, and snippets.

@asarazan
Created June 6, 2019 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asarazan/134a927a18d516350b02ccdf2d122b67 to your computer and use it in GitHub Desktop.
Save asarazan/134a927a18d516350b02ccdf2d122b67 to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEngine.UI;
namespace Dev
{
[RequireComponent(typeof(Text))]
public class FpsLog : MonoBehaviour
{
float _deltaTime = 0.0f;
private void Update()
{
_deltaTime += (Time.unscaledDeltaTime - _deltaTime) * 0.1f;
var fps = (int) (1.0f / _deltaTime);
Debug.Log($"Fps: {fps} [{Application.targetFrameRate}]");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment