Stopwatch.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
        // if I am holding down spacebar, progress the time elapsed
        if ( Input.GetKey (KeyCode.Space) ) {
            timeElapsed += Time.deltaTime;
        }

        // display current time elapsed; convert number to a string
        myTextObject.text = "TRY TO LAND EXACTLY ON #10\n" + timeElapsed.ToString();
    }

Usage Example

Example #1
0
 /// <summary>
 /// Updates the sensor
 /// </summary>
 private void Update()
 {
     if (scanTimer.Update(Time.deltaTime))
     {
         Scan();
         scanTimer.Reset();
     }
 }
All Usage Examples Of Stopwatch::Update
Stopwatch