Check out example codes for "check how long a bool has been true for unity". It will help you in understanding the concepts better.

Code Example 1

bool A;
float countDown = 3;
float stopwatch = 0;

if (A == true)
{
	stopwatch += Time.deltaTime;
    if (stopwatch >= countdown)
    {
    	Debug.Log("A has been true for 3 seconds");
   	}
}
else
{
	stopwatch = 0;
}

Learn ReactJs, React Native from akashmittal.com