A command to stop a script for some time

Basically, in Lua you can use a command called Wait(), which stops the script or waits for some time and then continues the script again. How can I do that in C#? Here is an example of a for loop in Lua:

for i = 1, 10 do //Goes from 1 to 10
       wait(2) //Waits for 2 seconds
       print("Waited for 2 seconds")
end

It is very easy to make loops or just to make something wait for a while. It is used a lot in Lua, but in C# it is way different as I know and it is very complex. So yeah, what would be the easiest way to write a similar code in C#?

As long as it’s in a coroutine (see tutorial above) you’d just do:

for(int i = 1; i <= 10; i++) {
  yield return new WaitForSeconds(2);
  Debug.Log("Waited for 2 seconds");
}