View previous topic :: View next topic |
Author |
Message |
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3355 Location: Jackass! Development Labs
|
Posted: Wed Jan 05, 2005 5:13 pm Post subject: How to Measure Elapsed Time for System Operations? |
|
|
I'm going to fly the n00b flag for a minute and ask a silly question -- what's the best way to measure the elapsed time that it takes for perform a job?
I've tried simple methods, but some of them will either choke or cause problems with running processes. In this circumstance, i'd like to accurately measure how much time it takes to complete an "emerge-e world" without interfering with the process.
TIA. _________________ .
Stage 1/3 | Jackass! | Rockhopper! | Thanks | Google Sucks |
|
Back to top |
|
|
timmfin Guru
Joined: 04 Sep 2002 Posts: 336 Location: Maryland, USA
|
Posted: Wed Jan 05, 2005 5:29 pm Post subject: |
|
|
The time command? From the time manpage
Code: |
The time command runs the specified program command with the given arguments. When command finishes, time writes a message to standard output giving timing statistics about this program run. These statistics consist of (i) the elapsed real time between invocation and termination, (ii) the user CPU time (the sum of the tms_utime and tms_cutime values in a struct tms as returned by times(2)), and (iii) the system CPU time (the sum of the ms_stime and tms_cstime values in a structtms as returned by times(2)).
|
|
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3355 Location: Jackass! Development Labs
|
Posted: Wed Jan 05, 2005 8:12 pm Post subject: |
|
|
yeah. i've tried using time, but emerge -e system doesn't fare well when executed under time. i've had it crash under time, where it works just fine without time.
times... maybe i need to try that. i could emerge -e system from a fresh shell and use times after the fact. _________________ .
Stage 1/3 | Jackass! | Rockhopper! | Thanks | Google Sucks |
|
Back to top |
|
|
Leffe Tux's lil' helper
Joined: 07 Apr 2004 Posts: 145 Location: Sweden
|
Posted: Wed Jan 05, 2005 8:53 pm Post subject: |
|
|
Just check the log (/var/log/emerge.log) if time doesn't work :)
Hmm, times are stored using timestamps :/ |
|
Back to top |
|
|
slam_head Guru
Joined: 06 Jan 2003 Posts: 449 Location: New York City
|
Posted: Wed Jan 05, 2005 8:59 pm Post subject: |
|
|
this might not be the most ellegant solution, but it should give you a good idea.
Code: | date;emerge -e system;date |
|
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3355 Location: Jackass! Development Labs
|
Posted: Wed Jan 05, 2005 10:49 pm Post subject: |
|
|
Leffe wrote: | Hmm, times are stored using timestamps :/ |
yeah, they're a PITA. i was hoping for a method that would just give me the elapsed time, so i wouldn't have to do date arithmetic. i'd really like to avoid using the log timestamps if i can get away with it.
maybe that idea of stacking a "date" command after "emerge -e system" isn't such a bad idea. it will write the date/time to screen as soon as the emerge finishes, and i won't miss anything if i'm not there to see it happen. _________________ .
Stage 1/3 | Jackass! | Rockhopper! | Thanks | Google Sucks |
|
Back to top |
|
|
|