> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/compute/guides-for-server-management/measure-the-execution-time-of-a-program-in-linux.md).

# Measure the execution time of a program in Linux

***

Sometimes, when you run larger batch jobs, you need to know how long they take to complete. This is exactly what the `time` command is used for.

For example, to measure the execution time of the fictional script `run_my_batch_job.sh`:

{% code title="Command" %}

```
time run_my_batch_job.sh
```

{% endcode %}

This will output something similar to this:

{% code title="Output" %}

```
real    9m38.935s
user    3m14.820s
sys     6m3.263s
```

{% endcode %}

From the output above, you can see that the batch job took **9 minutes and 38 seconds** to run. You can also see that **3 minutes** were spent in `user` mode and **6 minutes** in `system` mode.

Now you know how long the job took to execute. If you run the same job again, you’ll know how much time you have left for other tasks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.glesys.com/products/compute/guides-for-server-management/measure-the-execution-time-of-a-program-in-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
