Questions tagged [time-command]

command to run programs and summarize their resources usage, be it CPU time/usage, memory/swap use, IO, pagefaults, etc.

9 questions
92
votes
3 answers

Why doesn't the `time` command work with any option?

I tried to use time command with -f option to format the output of time, but I get the following error: -f: command not found Then I tried to use other options -a, -o, etc and I get the same error. Not even time --version doesn't work (--version:…
user258266
  • 1,244
  • 3
  • 10
  • 12
17
votes
1 answer

How can I automatically time commands in bash?

In tcsh, there's the variable time: The time shell variable can be set to execute the time builtin command after the completion of any process that takes more than a given number of CPU seconds. How do I do this in bash?
Eyal
  • 1,191
  • 1
  • 10
  • 12
15
votes
3 answers

Command not found when trying to set a format for the time command

I am trying to get the time it takes to run a command, with the output in a specific format: time -f "%E" ls -l This is similar to the example in the man page (and on the online man page). However when I run this command I get: -f: command not…
Isaac
  • 253
  • 2
  • 7
14
votes
2 answers

Why does the output format of time vary depending on how I call it

It may be a newbie's question, but I don't understand how this is configured and why the output format of time command is different in these two cases: if used via time, the output is three rows with basic info $ time sleep 1 real 0m1.003s user …
xaxa
  • 439
  • 3
  • 14
11
votes
1 answer

No such file or directory when executing /usr/bin/time

I'm building my own android rom. In order to build it, I need to run mka -j8 bacon However, I wanted to measure the time it took to build it, so I used /usr/bin/time -f "User\t%U\nSys\t%S\nReal\t%E\nCPU\t%P" mka -j8 bacon This won't run, because…
P1nGu1n
  • 213
  • 1
  • 2
  • 7
4
votes
1 answer

Why does running `time` and `/usr/bin/time` give different results?

Why does running time and /usr/bin/time give different results? /usr/bin/time thomas@tbdesktop:~$ /usr/bin/time -f "Elapsed time:%E" wc /etc/hosts 9 25 224 /etc/hosts Elapsed time:0:00.04 time thomas@tbdesktop:~$ time -f "Elapsed time:%E" wc…
Thomas Bratt
  • 710
  • 7
  • 12
4
votes
2 answers

Print terminal output in gedit automatically?

the command time ./myprog displays the time it took to run myprog on the screen. Now i would like to write this information to a text file. How?
user2413
  • 13,877
  • 17
  • 53
  • 87
2
votes
2 answers

How to use time command in bash, to sum sys + user time, and output it as milliseconds?

The time command returns a table like this? real 0m1.607s user 0m0.154s sys 0m0.032s I am running this inside a shell script. What's the simplest way to process time output so that I get a variable $RUNTIME which holds the sum user + sys in…
a06e
  • 12,613
  • 25
  • 66
  • 102
1
vote
4 answers

BASH: write the output of a command to a file

I run a program multible time using a bash script, and I want it's output to be written in a file. However, I couldn't make the operator ">filename.txt" work... Here is my script: for i in {1..10000000..10000} do time ./merge $i>nn done can…
Jim Blum
  • 1,407
  • 4
  • 19
  • 24