flat assembler
Message board for the users of flat assembler.
Index
> Linux > 'time' vs 'nice' vs 'time nice' vs 'nice time' |
Author |
|
donn 03 Feb 2020, 18:31
Weird..! Could it be the different time commands?
"Lets not use /usr/bin/time and use ‘time’ instead." https://www.thegeekstuff.com/2012/01/time-command-examples/ Maybe when you call time directly, it invokes 'time' instead of /usr/bin/time when called by nice. Not sure why nice would call /usr/bin/time, something to do with path search orders maybe? Going to set Linux back up again sometime this month... the CLI is so different from Powershell and Win. Want to return to it and try some stuff out. |
|||
03 Feb 2020, 18:31 |
|
revolution 04 Feb 2020, 12:46
Yes, you got it right. I hid the answer in the first post.
'time' is both a bash shell internal command, and an external program. And the outputs are different. When bash interprets the CLI input and sees 'time' ahead of another command it will start its own timer and execute the following command. So "time <command>" only uses the internal time in bash. But when 'nice' is first on the command line bash simply runs 'nice' and passes the arguments forward. So for "nice time <command>" when 'nice' runs and sees 'time' as the command it finds /usr/bin/time and runs that. This can be illustrated with: Code: ~ time nice time echo Hello World! Hello World! 0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 1776maxresident)k 0inputs+0outputs (0major+70minor)pagefaults 0swaps real 0m0.011s user 0m0.000s sys 0m0.004s |
|||
04 Feb 2020, 12:46 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.