> 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.
