Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created August 3, 2015 17:09
Show Gist options
  • Save unitycoder/b7b451cf05dded78eb76 to your computer and use it in GitHub Desktop.
Save unitycoder/b7b451cf05dded78eb76 to your computer and use it in GitHub Desktop.
Timer with ms
void Update () {
Debug.Log(FormatTime(Time.time));
}
string FormatTime(float t)
{
var time = System.TimeSpan.FromSeconds(t);
return string.Format("{0:D2}:{1:D2}:{2:D3}", time.Minutes, time.Seconds, time.Milliseconds);
}
@unitycoder
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment