What function to use, for this statement?

I use function Update in this script, but i need to use Waitforseconds. But as you know i cant use it in Update. Which function can i use?

#pragma strict

var rndNum:int;
var less = 5;
var asteroid : Transform;
var myposition : GameObject;

function Start () {

}

function Update () {

var rndNum: int = Random.Range(1, 100);

if(rndNum < less)
{
Instantiate(asteroid, myposition.transform.position, myposition.transform.rotation);


Debug.Log(rndNum);
}
}

Update is called every frame, so it makes no sense and won’t work to delay Update. You can use a coroutine instead:

function SpawnAsteroids()
{
while(true)
{
var rndNum: int = Random.Range(1, 100);

    if(rndNum < less)
    {
        Instantiate(asteroid, myposition.transform.position, myposition.transform.rotation);
    }
    yield WaitForSeconds(0.1f);
}

}