How to time a program or command in Linux

Ever wondered how long time a command takes to run? I did. A colleague showed me the time command. I’m here going to try to show how you can use it.

time ls

This will output something like this (plus the ls commands output):

real    0m0.369s                                                                                                                                           
user    0m0.002s                                                                                                             
sys     0m0.007s

Where the ‘real’ value is the one to look for. Pretty easy 🙂

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.