so i would like to minus a value (i.e. 50) within 0.0166667 second, i have tried startcoroutine in update(not accurate), in while loop (it end in 0 second) and also invoke method in while loop(blow my pc up) . this is the code of the start coroutine in while loop.
float x = 50, length = 0.0166667, g;
bool b = true;
void Update()
{
g = Time.time;
while (x>0)
{
StartCoroutine(Tt());
}
if(x == 0 && b == true)
{
Debug.Log(g);
b = false;
}
}
IEnumerator void Tt()
{
x -= 1;
yield return new WaitForSeconds(length / 50);
}
so this will give g =0 in debug.log, which is in accurate, and i am not sure whether it is the problem of Time.time or my code.