# Sleep
Source: https://www.inngest.com/docs/reference/python/steps/sleep

Sleep for a period of time. Accepts either a `datetime.timedelta` object or a number of milliseconds.

## Arguments

<Properties>
    <Property name="step_id" required type="str">
        Step ID. Should be unique within the function.
    </Property>

    <Property name="duration" required type="int | datetime.timedelta">
        How long to sleep. Can be either a number of milliseconds or a `datetime.timedelta` object.
    </Property>
</Properties>

## Examples

```py
@inngest_client.create_function(
    fn_id="my_function",
    trigger=inngest.TriggerEvent(event="app/my_function"),
)
async def fn(ctx: inngest.Context) -> None:
    await ctx.step.sleep("zzz", datetime.timedelta(seconds=2))
```