My timer wont work in unity

In my game, you can spawn a cube by clicking. After 10 seconds I want the cube to disappear. That’s what I’m trying to do in my code but it won’t work:

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;  public class circleThing : MonoBehaviour {     public GameObject circle;     public GameObject block;     public float time;     void Start() {          Vector3 temp = Camera.main.ScreenToWorldPoint(Input.mousePosition);          temp.z = 5f;          transform.position = temp;          if (Input.GetMouseButtonDown(0)) {              StartCoroutine(timer());              Instantiate(block, temp, Quaternion.identity);          }          if (time >= 10) {              Destroy(block);          }     }     void Update()     {            }      IEnumerator timer(){          while (true)         {             Debug.Log(time);             yield return new WaitForSeconds(1);             time++;         }     } } 

What am I doing wrong? I get the error: Destroying assets is not permitted to avoid data loss.