# WaitForSeconds

> Suspends the coroutine execution for the specified scaled time in seconds.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Inherits from:** [YieldInstruction](/engine/6000.7/script-reference/unityengine/yieldinstruction.md)

```csharp
public sealed class WaitForSeconds : YieldInstruction
```

## Remarks

[WaitForSeconds](/engine/6000.7/script-reference/unityengine/waitforseconds.md) can only be used with a `yield` statement in coroutines.

The real time suspended is equal to the given time divided by [Time.timeScale](/engine/6000.7/script-reference/unityengine/time/timescale.md). To wait using unscaled time, refer to [WaitForSecondsRealtime](/engine/6000.7/script-reference/unityengine/waitforsecondsrealtime.md).

The actual length of time waited might not match the time specified for the following reasons:

* If you start `WaitForSeconds` with duration `t` in a long frame (for example, one which has a long operation which blocks the main thread such as some synchronous loading), the coroutine resumes `t` seconds after the end of the frame rather than `t` seconds after it was called.
* The coroutine might resume on the first frame after `t` seconds has passed rather than immediately after `t` seconds has passed.

```csharp
using UnityEngine;
using System.Collections;

public class WaitForSecondsExample : MonoBehaviour
{
    void Start()
    {
        //Start the coroutine we define below named ExampleCoroutine.
        StartCoroutine(ExampleCoroutine());
    }

    IEnumerator ExampleCoroutine()
    {
        //Print the time of when the function is first called.
        Debug.Log("Started Coroutine at timestamp : " + Time.time);

        //yield on a new YieldInstruction that waits for 5 seconds.
        yield return new WaitForSeconds(5);

        //After we have waited 5 seconds print the time again.
        Debug.Log("Finished Coroutine at timestamp : " + Time.time);
    }
}
```

Additional Resources: [MonoBehaviour.StartCoroutine](/engine/6000.7/script-reference/unityengine/monobehaviour/startcoroutine.md), [AsyncOperation](/engine/6000.7/script-reference/unityengine/asyncoperation.md), [WaitForEndOfFrame](/engine/6000.7/script-reference/unityengine/waitforendofframe.md), [WaitForFixedUpdate](/engine/6000.7/script-reference/unityengine/waitforfixedupdate.md), [WaitForSecondsRealtime](/engine/6000.7/script-reference/unityengine/waitforsecondsrealtime.md), [WaitUntil](/engine/6000.7/script-reference/unityengine/waituntil.md), [WaitWhile](/engine/6000.7/script-reference/unityengine/waitwhile.md).

## Constructors

| Constructor                                                                                         | Description                                                                         |
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [WaitForSeconds(System.Single)](/engine/6000.7/script-reference/unityengine/waitforseconds/ctor.md) | Suspends the coroutine execution for the given amount of seconds using scaled time. |
