# Gather execution time of several request to one value

**URL:** <https://community.gatling.io/t/gather-execution-time-of-several-request-to-one-value/4162>\
**Category:** Gatling (Open-Source)\
**Created:** [February 7, 2018, 1:28pm UTC](https://community.gatling.io/t/gather-execution-time-of-several-request-to-one-value/4162 "2018-02-07T13:28:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yevhen\_Kuzmenko](https://avatars.discourse-cdn.com/v4/letter/y/5f8ce5/32.png) [@Yevhen\_Kuzmenko](https://community.gatling.io/u/Yevhen_Kuzmenko)\
**Post date:** [February 7, 2018, 1:28pm UTC](https://community.gatling.io/t/gather-execution-time-of-several-request-to-one-value/4162/1 "2018-02-07T13:28:53Z")

</div>

```auto
I have an asynchronius process and I want to gather performance statics of it.
I wrote the code which waits async process:

```

.asLongAs(session =\> !session.contains(“cartStatus”) || session(“cartStatus”).as[String] != “CALCULATED”) {

```auto
  exec(
    http("get cart")
      .get("/carts/${cartCode}")
      .header("Accept", "application/json")
      .header("Content-Type", "application/x-www-form-urlencoded")
      .check(jsonPath("$..cartStatus").exists.saveAs("cartStatus")))
  .pause(5)
}

I want to see time of performing asLongAs loop at the report, but currently I see time of each "get cart" call.

Is there any way to do this? 

```

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [February 7, 2018, 1:46pm UTC](https://community.gatling.io/t/gather-execution-time-of-several-request-to-one-value/4162/2 "2018-02-07T13:46:14Z")

</div>

group

---

<div class="post-metadata">

**Author:** ![Yevhen\_Kuzmenko](https://avatars.discourse-cdn.com/v4/letter/y/5f8ce5/32.png) [@Yevhen\_Kuzmenko](https://community.gatling.io/u/Yevhen_Kuzmenko)\
**Post date:** [February 7, 2018, 3:04pm UTC](https://community.gatling.io/t/gather-execution-time-of-several-request-to-one-value/4162/3 "2018-02-07T15:04:16Z")

</div>

Thanks Stéphane for your answer. It almost solved my problem. Currently it calculates time of requests only. How can I add time of pauses to the statistics?

---

<div class="post-metadata">

**Author:** ![Michael\_C](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Michael\_C](https://community.gatling.io/u/Michael_C)\
**Post date:** [February 8, 2018, 12:07am UTC](https://community.gatling.io/t/gather-execution-time-of-several-request-to-one-value/4162/4 "2018-02-08T00:07:58Z")

</div>

I can help with that.

In the gatling.conf file try changing this setting

```auto
useGroupDurationMetric = true # Switch group timings from cumulated response time to group duration.

```

```auto

```

---

<div class="post-metadata">

**Author:** ![Yevhen\_Kuzmenko](https://avatars.discourse-cdn.com/v4/letter/y/5f8ce5/32.png) [@Yevhen\_Kuzmenko](https://community.gatling.io/u/Yevhen_Kuzmenko)\
**Post date:** [February 8, 2018, 8:17am UTC](https://community.gatling.io/t/gather-execution-time-of-several-request-to-one-value/4162/5 "2018-02-08T08:17:54Z")

</div>

That solved my issue. Thanks you
