Coroutine about waiting not working

void Awake ()
{
Count();
}

void Count (int sec = 10)
{
    for (int i = 0; i < 10; i++)
    {
        print(sec);
        StartCoroutine(Delay());
        sec -= 1;
        
        if (sec < 1)
        {
            print("GO!");
            StopCoroutine(Delay());
        }
    }
}

IEnumerator Delay(int waitSec = 10)
{
    yield return new WaitForSeconds(waitSec);
}

The result is that the console instantly print everything without waiting for ten seconds even with this coroutine. Why so?

Thanks!

Coroutines execute independently from the rest of the script. “StartCoroutine” is treated as any other function. If you want this to be executed with delay, I suggest this:

IEnumerator Delay
{
 for (int i = 0; i < 10; i++)
     {
         print(sec);

         yield return new WaitForSeconds(10);

         sec -= 1;
         
         if (sec < 1)
         {
             print("GO!");
         }
     }
}