Time.time explanation in Unity with example

Hello programmers, In this article, you will learn about Time.time in Unity with the help of an example in C#.

Before we get started with the building process, we need to know a few concepts. Let’s first discuss them one by one.


  • Time is a public static field in a time class.
  • Time.time returns the time passed in seconds since the game started.


  • It is affected by Time.timeScale.
  • If the game or application is paused then the Time.time is also be paused and scales or descales according to Time.timeScale value.


  • Time.time can be used to display the timer in games.
  • It is used to track the total gameplay time excluding the paused time.


using System.Diagnostics;
using UnityEngine;

public class TimeManager : MonoBehaviour
    // Start is called before the first frame update
    void Start()

    // Update is called once per frame
    void Update()


if we run the code, then we can see the given result in the console:

Time.time in Unity

Leave a Reply

Your email address will not be published. Required fields are marked *