LinuxCommandLibrary

speed.1s

Measure network connection speed

SYNOPSIS

speed [options] command [arguments...]

PARAMETERS

-n
    Specifies the number of iterations the command should be executed. Defaults to 10 if not specified.

-w
    Warmup iterations, commands before measuring. Defaults to 2.

-e
    Exit on first non-zero exit status.

-E
    Exit on first non-zero exit status, or error

-f
    Output format, can be table, json, csv or raw. Defaults to table.

-j
    Run commands in parallel. Defaults to 1 (no parallelism).

-c
    Number of concurrent jobs. Defaults to the same as the number of cores.

DESCRIPTION

speed is a command-line utility used to measure the execution time of other commands.
It executes the specified command multiple times, then calculates and displays statistics such as average execution time, minimum execution time, maximum execution time, standard deviation, and median execution time. This allows you to benchmark the performance of different commands or configurations. speed helps identify performance bottlenecks and optimize command execution. The number of iterations can be specified to obtain more accurate results. The tool is invaluable in situations where precise measurements of command duration are needed and where subtle performance differences need to be detected. It offers a simple and clear way to compare command performance and identify any fluctuations. speed gives a deeper insight into the effect of changes of your code.

EXAMPLES

speed ls -l: Measures the execution time of the ls -l command.
speed -n 100 cat file.txt: Executes cat file.txt 100 times and measures the execution time.
speed -n 20 -j 4 ./my_script.sh: Executes ./my_script.sh 20 times using 4 parallel threads.

SEE ALSO

time(1), perf(1)

Copied to clipboard