[SOLVED] Really simple terminal question: is there a way to "time" a compression test with 7z?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Really simple terminal question: is there a way to "time" a compression test with 7z?
I'm not looking for anything fancy here, I suppose I could record every output in the bash terminal using a combination of script and tee, but I don't believe that records timestamps of every output? I'm looking for an implementation of this in the future because it would be great to store logs (and timestamps) from the terminal output.
In the meantime, here's what I've come up:
Code:
date && 7z a litecoin-archive .litecoin/ -m0=LZMA2 -mx=7 && date
My understating is that commands will be executed sequentially delimited by "&&" so the above line would record the starting and ending time of a lengthy procedure (especially on a dual-core cpu.) The archive manager in MATE 1.14.1 has no gui method parameter options so forcing LZMA2 in the terminal is going to produce the best results here (not to mention utilize both cpu cores compared to other compression formats.) And yes, I'm aware LZMA2 is "really only going to be substantial" at 4 or more threads, but I need all the efficiency I can get at -mx=7
time ls
real 0m0.003s
user 0m0.000s
sys 0m0.002s
\time ls
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 900maxresident)k
0inputs+0outputs (0major+269minor)pagefaults 0swaps
Btw just a passing curiosity, "time" isn't going to substantially-negatively affect the performance of a cpu benchmark like this right? If the cpu is already being pegged at ~100% on both cores for the duration of the compression test, would tracking "cpu seconds" (user and sys time) use minimal resources?
Yet another thing worth mentioning if anyone's keeping track here, my distro's terminal emulator, "mate-terminal" has a default scrollback of 512 lines. That's an issue if you want to track a non-piped output of a lengthy process (like indeed compressing blockchain app data using 7z) in a default terminal window size because the initial output will get cut off and be lost. In the profile preferences in your terminal, there's an option for "unlimited" scrollback so I've set this from now on. 512 lines seems a bit conservative to me.
Ideally in the future I would be looking around for an emulator that has the ability to log and timestamp every line of output by default (not just on the prompts as my previous link explains. Here's an expounded article on how to export the timestamps on every prompt viewable in "history" by modifying the .bashrc file.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.