---
title: "Measuring Command Execution Time"
description: "Learn how to measure the execution time of shell commands using the `time` command."
date: "2025-02-04"
tags: ["shell","timeit","performance"]
canonical: "/snippets/shell/timeit"
---

import { Code } from '@astrojs/starlight/components'
import Source from './timeit.sh?raw'

## How can I measure a command's execution time?

This can be useful when you want to compare the performance of different
commands, scripts or libraries.

<Code code={Source} lang="sh" title="timeit.sh" wrap />
