How do i make the raycast only last for 1 or 2 seconds? i don't want the user to hold raycast to destroy the object.

{
Ray ray;
RaycastHit hit;

void Update () 
{
	if (Input.touchCount > 0 || Input.GetTouch (0).phase == TouchPhase.Began) // when you touch at the start
	{	
		ray = Camera.main.ScreenPointToRay (Input.GetTouch (0).position); // creating a ray 
		Debug.DrawRay (ray.origin, ray.direction * 20, Color.red);// visiually see where the ray is going
		if (Physics.Raycast (ray,out hit,Mathf.Infinity))  // this when oject is hit something
		{
			Destroy (hit.transform.gameObject);
			Debug.Log ("Hit something"); // if it hits shows on concolue
		}

	}   
}

}

There is a simple mistake you made … change || to &&