Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created August 3, 2015 17:09
Show Gist options
  • Select an option

  • Save unitycoder/b7b451cf05dded78eb76 to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/b7b451cf05dded78eb76 to your computer and use it in GitHub Desktop.

Revisions

  1. unitycoder created this gist Aug 3, 2015.
    9 changes: 9 additions & 0 deletions timer.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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);
    }