![Forrest logo](/images/logo.png)
timed:tldr:6c86e
The "timed" command is a Linux command-line utility that is used to execute a specified command and measure the amount of time taken to complete it. It is commonly used for benchmarking purposes or to analyze the performance of a particular command.
When using the "timed" command, you would typically provide the command that you want to measure the execution time for as an argument. For example:
timed ls -l
This command would execute the "ls -l" command (which lists detailed information about files and directories in the current directory) and display the execution time in seconds. The output of the "timed" command shows the real time, user time, and system time taken by the specified command.
Here's an example of possible output from the "timed" command:
Command exited with non-zero status 2
Command being timed: "ls -l"
User time (seconds): 0.01
System time (seconds): 0.00
Percent of CPU this job got: 0%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 0
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 135
Voluntary context switches: 1
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 8
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 2
In this example, the command "ls -l" took 0.01 seconds of user time and 0.00 seconds of system time. The total elapsed time (wall clock time) was 0 minutes and 2 seconds (0:02.00). The command exited with a non-zero status code 2. Other information such as memory usage, context switches, and file system interactions are also provided in the output.