# How to add a pause or sleep before retry?

**URL:** https://community.gatling.io/t/how-to-add-a-pause-or-sleep-before-retry/3578
**Category:** Gatling (Open-Source)
**Created:** [February 23, 2017, 6:26am UTC](https://community.gatling.io/t/how-to-add-a-pause-or-sleep-before-retry/3578 "2017-02-23T06:26:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Feng\_Yu](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@Feng\_Yu](https://community.gatling.io/u/Feng_Yu)
#### Post date: [February 23, 2017, 6:26am UTC](https://community.gatling.io/t/how-to-add-a-pause-or-sleep-before-retry/3578/1 "2017-02-23T06:26:49Z")

</div>

I find a retryMax() that can be used to retry a fail. But how could I add a sleep before retry?

If failed → sleep some time → then retry.

---

<div class="post-metadata">

### Author: ![Feng\_Yu](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@Feng\_Yu](https://community.gatling.io/u/Feng_Yu)
#### Post date: [February 23, 2017, 9:41am UTC](https://community.gatling.io/t/how-to-add-a-pause-or-sleep-before-retry/3578/2 "2017-02-23T09:41:42Z")

</div>

I solved my issue. Just add a pause() before exec().

`tryMax(3){ pause(3) .exec(http('login')) }`

在 2017年2月23日星期四 UTC+8下午2:26:50，Feng Yu写道：
