Monster starts attack when player enter to sphere collider

Hello guys I want to create a monster attack script I already created a monster movement but now I need to create something like that:

If player enter to sphere collider enemy starts hitting with delay 1 sec.

Or should I do it with another way ?

(I wanted to use Raycast but I dont know its a good idea)

Can you guys help me with that ?

  void OnTriggerEnter (Collider other)
    	{
    		
    		if (other.gameObject.tag == "Player") 
    		{
    			Debug.Log ("He entered");
    			playerInSphere = true;
    
    		}
    	}
    
    void Update ()
    	{
    		if (playerInSphere == true)
    		{
    			//hit player
    
    		}
    	}

What do you want to do it seems that your script already does what you want.
Clarify more your answer.