Stopping my timer when all pick ups are collected.

I’m trying to add a timer to the rolling ball tutorial to make it track how long it takes you. i got the timer to run but i’m trying to make the timer stop when “You Win!” appears. Help would be greatly appreciated. here’s the code i have for it if that helps.

also i’m a beginner to C#.

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class PlayerController : MonoBehaviour {

public float speed;
public Text countText;
public Text winText;
public Text timerText;
public float startTime;

private Rigidbody rb;
private int count;

void Start ()
{
	rb = GetComponent<Rigidbody> ();
	count = 0;
	setCountText ();
	winText.text = "";
	startTime = Time.time;
}

void Update ()
{
	float t = Time.time - startTime;

	string minutes = ((int)t / 60).ToString ();
	string seconds = (t % 60).ToString ("f2");

	timerText.text = minutes + ":" + seconds;
}

void FixedUpdate ()
{
	float moveHorizontal = Input.GetAxis ("Horizontal");
	float moveVertical = Input.GetAxis ("Vertical");

	Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

	rb.AddForce (movement * speed);
}

void OnTriggerEnter(Collider other) 
{
	if (other.gameObject.CompareTag ("Pick Up")) 
	{
		other.gameObject.SetActive (false);
		count = count + 1;
		setCountText ();
	}
}
	
void setCountText ()
{
	countText.text = "Count: " + count.ToString ();
	if (count >= 12) 
	{
		winText.text = "You Win!";
	}
}

}

I would add a boolean member variable, and a float member, to your class. The boolean states whether or not the timer is still running. Set this variable to true when the game starts, and set it to false when the player wins. The float variable will store the timer value, which you can conditionally increment depending on the bool. (uncompiled example code)

float timerValue=0;
bool timerRunning=true;

if(timerRunning)
   timerValue=Time.time - startTime; //since this is writing to a member variable, it will keep this value, even if not set next update cycle.

if (count >= 12) 
{
   timerRunning=false;
   winText.text = "You Win!";
}