function inside update stopped after 32 frames

I am trying to manually create a timer for an effect in game. The effect is speeding up.
So I use the following code to run the countdown timer. This code runs. However, the debug log shows it only run for 32 times. I have no idea why.

    using UnityEngine;
    using System.Collections;

public class NoteController : MonoBehaviour
{
private float timeSpeedUp = 5f;
    private bool isSpeedUp = false;

void Update ()
	{
		if (isSpeedUp) 
		{	
			timeSpeedUp -= 1 / 24f;
			Debug.Log ("time decrease " + timeSpeedUp);
			if (timeSpeedUp < 0) 
			{
				isSpeedUp = false;	
				timeSpeedUp = defaultTimeSpeedUp;
			}
		}
	}    
}

P/S: I know there are other ways to do time like Invoke and Waitforseconds. So why post this? What I really want is to know WHY it only run for 32 times. I am still very new at working with Unity. Not knowing it just may create future problems since like it or not, I have to use Update often.

Ran your code in unity (with some simplifies) - it works ok, I’ve seen about 40 log records.
I guess a bug is out code you posted here. First idea is that something sets isSpeedUp to false out of Update function. Who could do this? Who sets isSpeedUp to true?

Second idea is that your timeSpeedUp reaches defaultSpeedUp within 32 Update calls. What is the defaultSpeedUp value?

Anyway, it would be better to see all the project (or reduced copy of it, where your bug could be reproduced).

Well I would guess that your computer runs at a speed that

32 * 1/24 => 5

As a result, timeSpeedUp is less than 0 after 32 frames and your counter stops since you are setting isSpeedUp to false so the counter is off.

Now for a better control use Time.deltaTime:

 void Update ()
 {
     if (isSpeedUp) 
     {    
         timeSpeedUp -= Time.deltaTime; // Will run for 5 seconds
         Debug.Log ("time decrease " + timeSpeedUp);
         if (timeSpeedUp < 0) 
         {
             // isSpeedUp = false;   remove this one so the counter gets back to 5 and goes on  
             timeSpeedUp = defaultTimeSpeedUp;
         }
     }
 }