# Get query execution time

**URL:** <https://community.stardog.com/t/get-query-execution-time/2189>\
**Category:** Support\
**Created:** [January 10, 2020, 11:29am UTC](https://community.stardog.com/t/get-query-execution-time/2189 "2020-01-10T11:29:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_Julio\_Ramirez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/victor_julio_ramirez/32/431_2.png) [@Victor\_Julio\_Ramirez](https://community.stardog.com/u/Victor_Julio_Ramirez)\
**Post date:** [January 10, 2020, 11:29am UTC](https://community.stardog.com/t/get-query-execution-time/2189/1 "2020-01-10T11:29:03Z")

</div>

Hi,  
Is there any way to get the query execution time and query response time with the CLI?. I mean, the time that the query engine takes to prepare the response, not the total query time (taking into account the reception of the response).

To clarify, I have a query that returns :  
` Query returned 2,505,600 results in 00:03:09.474`

Using **stardog-admin server status** , I get:

```
+--------------------------------------------+
| Queries |
+---------+-------+---------------+----------+
| Running | Total | Avg. Time (s) | Rate/sec |
+---------+-------+---------------+----------+
| 0 | 1 | 177.554 | 0.003 |
+---------+-------+---------------+----------+

```

With **time** command :

```
real	3m10,984s
user	0m52,081s
sys	0m13,744s

```

And with a chronometer (not accurate):  
CLI starts to show the results: `2m10,160s`  
query finished after: `1m01,260s`  
Total: `3m11,430s`

Thus, the total query time is very similar between **stardog** , **time** and **chronometer**. But **stardog-admin server status** shows around 12 seconds less and with a chronometer the data start to appear 1 minute early.

Some DB engines have a setting where the output can be removed, so the query time shown doesn't take into account the print-to-screen data time.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![pavel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pavel/32/18_2.png) [@pavel](https://community.stardog.com/u/pavel)\
**Post date:** [January 10, 2020, 1:17pm UTC](https://community.stardog.com/t/get-query-execution-time/2189/2 "2020-01-10T13:17:16Z")

</div>

The server will not send the pure evaluation time to the client as a part of the response. You have a couple options to access it on the server side:

- using the slow query log for the database, cf. [Home | Stardog Documentation Latest](https://www.stardog.com/docs/#_slow_query_logging) and [Home | Stardog Documentation Latest](https://www.stardog.com/docs/#_stardog_configuration)
- by requesting metric values, e.g. `stardog-admin server metrics databases.{name}.queries.speed.*`. The values are aggregates, not for individual queries.

Best,  
Pavel

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [January 24, 2020, 1:17pm UTC](https://community.stardog.com/t/get-query-execution-time/2189/3 "2020-01-24T13:17:21Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
