[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedJune 27, 2023

How to use time command.

How To Use Time Command.

In this article we will show you how to use time command.

For example, if you have two different scripts doing the same job and you want to know which one performs better you can use the Linux time command to determine the duration of execution of each script.

 

Time Command Versions

type time
# Bash
time is a shell keyword

# Zsh
time is a reserved word

# GNU time (sh)
time is /usr/bin/time

 

Using Linux Time Command.

time wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.19.9.tar.xz

What will be printed as an output depends on the version of the time command you’re using:

# Bash
real	0m33.961s
user	0m0.340s
sys	0m0.940s

# Zsh
0.34s user 0.94s system 4% cpu 33.961 total

# GNU time (sh)
0.34user 0.94system 0:33.96elapsed 4%CPU (0avgtext+0avgdata 6060maxresident)k
0inputs+201456outputs (0major+315minor)pagefaults 0swaps
  • real or total or elapsed (wall clock time) is the time from start to finish of the call. It is the time from the moment you hit the Enter key until the moment the wget command is completed.

  • user – amount of CPU time spent in user mode.

  • system or sys – amount of CPU time spent in kernel mode.

 

Conclusion

By now you should have a good understanding of how to use the time command.

Keep reading
How to Change Root Password in Ubuntu Linux
March 13, 2023

How to Change Root Password in Ubuntu Linux

How To Change Root Password In Ubuntu Linux This tutorial explains how to temporally change to the root user account and how to set the root password on Ubuntu systems. The root user (or superuser) is a special user account that is present on all Linux and Unix-like systems. It has full access to…

Read article
How to use History Command in Linux.
March 13, 2023

How to use History Command in Linux.

How To Use History Command In Linux. In this article, we will talk about the history command, which allows you to view a list of previously executed commands, search through the list, and manipulate the history file. Using the history Command and History Expansions history is a shell builtin, and…

Read article
How to Run Linux Commands in Background
March 13, 2023

How to Run Linux Commands in Background

How To Run Linux Commands In Background. In this article, we will talk about the background processes is Linux. We will show you how to start a command in the background and how to keep the process running after the shell session is closed. In this article, we will talk about the background…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00