Check out example codes for "unity interval timer". It will help you in understanding the concepts better.

Code Example 1

public Rigidbody projectile;

void Start(){
  					//(methodname, timeUntilFirstCall, repeatTime)
	InvokeRepeating("LaunchProjectile", 2.0f, 0.3f); //time needs to be > 0
}

void LaunchProjectile(){
	Rigidbody instance = Instantiate(projectile);
	instance.velocity = Random.insideUnitSphere * 5;
}

Learn ReactJs, React Native from akashmittal.com