# pause a variable time

**URL:** <https://community.gatling.io/t/pause-a-variable-time/560>\
**Category:** Gatling (Open-Source)\
**Created:** [August 29, 2013, 9:30pm UTC](https://community.gatling.io/t/pause-a-variable-time/560 "2013-08-29T21:30:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shawna](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Shawna](https://community.gatling.io/u/Shawna)\
**Post date:** [August 29, 2013, 9:30pm UTC](https://community.gatling.io/t/pause-a-variable-time/560/1 "2013-08-29T21:30:45Z")

</div>

How can I pause a variable time?

e.g I have a scenario that each user will do something together after 10 minutes since first started. So each user will compare its time to the very start time and pause accordingly. But seems like pause does not support that?

.exec(JCALogin.login1)  
.exec(session =\>{  
var time = common.Common.compareStartTime  
var diffTime = waitTime - time  
println(diffTime )  
session.setAttribute(“waitTime”, diffTime)  
})

.pause(${diffTime})

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [August 30, 2013, 8:04am UTC](https://community.gatling.io/t/pause-a-variable-time/560/2 "2013-08-30T08:04:26Z")

</div>

Yes it does, but it expects a Duration, not an Int (or Long).

Moreover, you don’t have to first store in the session:

.pause(session =\> {  
var diffTime = waitTime - common.Common.compareStartTime  
println(diffTime)

diffTime.success  
})
