make a script wait without using update?

is there any easy way to do something like

void fire()
{
//fire code
wait for reload time
reload();
}

void reload()
{
//reload code
}

i could probably hack it using update but it seems messy.

i’d like to just do
yield waitforseconds(reloadtime)
but it seems you can only use yield(i think)
if you enter a function from an update (i think)
not sure.

basically i tried doing a yield WaitForSeconds inside a function and
yield shows up
but waitforseconds doesn’t.

I can just type break or return.

Isn’t the following working for you?

void Fire()
{
  StartCoroutine(DoFire()); // Coroutine needs to be called with 'StartCoroutine'
}

IEnumerator DoFire()
{
   yield return new WaitForSeconds(1f);
}

You can Call ‘Fire()’ from wherever you want (do not need the ‘Update’ function).

The monobehaviour script (the script holding the coroutine) must be enabled in order for the coroutine to run.