# Testing average response time with newman

**URL:** <https://community.postman.com/t/testing-average-response-time-with-newman/3189>\
**Category:** Help Hub\
**Tags:** newman-project\
**Created:** [November 5, 2018, 8:44pm UTC](https://community.postman.com/t/testing-average-response-time-with-newman/3189 "2018-11-05T20:44:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![inglese.andrea](https://avatars.discourse-cdn.com/v4/letter/i/ce7236/32.png) [@inglese.andrea](https://community.postman.com/u/inglese.andrea)\
**Post date:** [November 5, 2018, 8:44pm UTC](https://community.postman.com/t/testing-average-response-time-with-newman/3189/1 "2018-11-05T20:44:01Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

When testing some apis with newman, i’m tryng to test if the response time is lower than 200ms. sometimes, this test would file for environment condition, so i would like to iterate the request many times, and test the average response time instead of the single request response time. is this possible? how?

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/victor/32/625_2.png) [@Victor](https://community.postman.com/u/Victor)\
**Post date:** [November 7, 2018, 8:06am UTC](https://community.postman.com/t/testing-average-response-time-with-newman/3189/2 "2018-11-07T08:06:22Z")

</div>

I guess, the simplest way would be to have a counter variable and at the end of your response testing stage you check if you need to repeat the request with

```
postman.setNextRequest("test name");

```

or you are done

```
postman.setNextRequest(null);

```

For details, see [https://www.getpostman.com/docs/v6/postman/scripts/branching\_and\_looping](https://www.getpostman.com/docs/v6/postman/scripts/branching_and_looping)

---

<div class="post-metadata">

**Author:** ![Poundesville](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Poundesville](https://community.postman.com/u/Poundesville)\
**Post date:** [November 9, 2018, 2:15pm UTC](https://community.postman.com/t/testing-average-response-time-with-newman/3189/3 "2018-11-09T14:15:31Z")

</div>

I use test script and put the test result with the response time. At the end of the Runner, I export the results which would be in json format.

Next I open the json file using Excel and focus only on test result. From there I will see only the test results on rows of Excel.

The problem is Test is not executed when there is time out or any other error during APi execution.
