Questions tagged [time]

time is a command line utility for running another program and summarizing resource usage

time runs another program and keeps track of how much resources the program has spent. It prints these (normally to stdout) after the program exits.
Basic usage:

time PROGRAM

Additional options (to be specified between time and PROGRAM) allow for redirecting time's output to file (-o filename) optional with appending to that file (-a) and for formatting of the output.

501 questions
52
votes
4 answers

Why real time can be lower than user time

I have a script converting video files and I run it at server on test data and measure its time by time. In result I saw: real 2m48.326s user 6m57.498s sys 0m3.120s Why real time is that much lower than user time? Does this have any…
kobylecki
  • 623
20
votes
3 answers

How to get the time of several commands with a loop

I have this command: time -p sh -c 'command1; command2;' So command1and command2 is executed and I get the real, user and sys time printed on the console. But I want that command1; command2; is looped 10 times and then I want to get the time which…
Tim
  • 303
12
votes
1 answer

What is "system time" when using "time" in command line

Im using time to time a Perl script on standard terminal in Ubuntu 14.04. I have read that real time is stopwatch time; the time I, as a user, is spending looking at the program running from I start the program until it terminates. But I don't get…
Alrekr
  • 223
9
votes
3 answers

Unix time, leap seconds, and converting Unix time to a date

I read many, many posts about Unix time and many say that a day is 86400 seconds. But pages like this talk about leap seconds. And this made me confused. And I read that Unix time is based on UTC, and all I can understand is that the different…
Okoba
  • 93
4
votes
1 answer

How can I determine the wall clock time of a process?

I have found the general Linux program time, which times a command. For example, suppose I want to time the execution of foo. I can use: time foo which gives this sample output: real 0m8.738s user 0m5.796s sys 0m0.576s However, the man…
Andrew
  • 16,855
4
votes
1 answer

What happens at the end of time?

I am curious why a signed integer value was used to hold Unix time. It clearly would have made significantly more sense to use an unsigned integer as time can't go backwards, so having a negative value for time is, well, impossible. However, on…
4
votes
2 answers

Why I can't use the time command in verbose mode without specifying the whole command path?

Given that... ~$ which time time is a shell keyword time is /usr/bin/time Why this works? ~$ /usr/bin/time --verbose ./some_script.sh Command being timed: "./some_script.sh" User time (seconds): 0.00 System time (seconds): 0.01 Percent of CPU this…
3
votes
3 answers

How to `time` a command N times (and be able to use CTRL-C to stop it)

Short question: This is done on a Mac: time for i in {1..10}; do python3 foo.py ; done but CTRL-C won't be able to stop it. How to make it work? (or how to time the running time of N times?) Details: There is some standard test of program from…
nonopolarity
  • 3,069
3
votes
1 answer

how to time several background processes

I have a script s: echo a & echo b & echo c & Now I want to know how much time it will take for the script to finish. I try time bash s But it gives me an immediate result which is not the correct one(my script is of course much more complicated…
3
votes
1 answer

What harm does a leap second cause on a Unix system?

RedHat gives a warning on its homepage: A leap second event will occur on 2016 December 31, 23h 59m 60s UTC. It's prefixed by an exclamation mark which seems to read important. What harm does a leap second cause on a system? How do we deal with…
Cyker
  • 4,274
  • 7
  • 36
  • 46
3
votes
3 answers

Must set CMOS clock to localtime (due to DOS dual boot), timedatectl or hwclock seems to keep setting CMOS (hardware) clock to UTC!

This is beyond crazy. I have a dual-boot system, one OS is FreeDOS (which has NO ability to deal with CMOS clock being anything other than local time), and the other is Linux Mint 17. The way this system is used is that we sit in Linux waiting for a…
RustyCar
  • 211
2
votes
1 answer

How to Run time command by default when certain commands are run?

Wondering if there is a way to run time command in Linux by default when certain commands are run.
2
votes
1 answer

/usr/bin/time command -v not working

I know many questions have been asked/answered about the time command, but mine still seems to be not working. I have been doing like everyone suggests, and using /usr/bin/time, which seems to work, but every time I trying using /usr/bin/time -v or…
Jacob
  • 23
2
votes
1 answer

define own time in linux

how to set time in linux in that way: 1 second define as 10 seconds (10 second = 1 secods of own time) I want fool all processes runned there to use 10x faster time. so sleep(1) will last 0.1 real seconds. how to achieve it?
1
vote
2 answers

Can i use time A | B to measure the time taken to run A | B?

I imagine time A | B would only measure the time taken to run A (since the argument to time is A). What's the solution ?
boredaf
  • 181
1
2