wall-clock time profiling
Bill Campbell
freebsd at celestial.com
Thu May 31 03:24:58 UTC 2007
On Thu, May 31, 2007, Akihiro KAYAMA wrote:
>In article <465DB587.6010109 at mac.com>,
>Chuck Swiger <cswiger at mac.com> writes:
>
>cswiger> Akihiro KAYAMA wrote:
>cswiger> > Hi all.
>cswiger> >
>cswiger> > What is the right way to measure wall-clock time in profiling on FreeBSD?
>cswiger>
>cswiger> The time shell builtin command or "/usr/bin/time -l _program_"?
>cswiger>
>cswiger> The latter variant displays the rusage struct (ie, from "man getrusage")?
>
>Thanks for your response.
>
>Yes, we can know whether the program is I/O bound or CPU bound by
>time(1). But it is still unclear which part of the program is really
>waiting for I/O. So profiling is needed for tuning, although CPU time
>profiling gives me non-distinct result on I/O bound programs. It is
>reason why I want wall-clock time profiling.
Wall clock time doesn't generally tell you anything reliably
useful on a multi-tasking system as it's very dependent on other
system activity. I had many fights back in the mid '70s with
people in accounting who wanted to bill wall-clock time on
Burroughs main frames which generally had 20 programs in the mix
at any time (I guess they were accustomed to IBM 360s that
couldn't walk and chew gum at the same time :-).
If I had to measure wall-clock time for proceses, I would
probably write a simple wrapper script to execute the command
getting the system time before and after running the command I
wanted to time:
#!/usr/bin/env python
import os, time
tstart = time.time()
os.system('some command')
tend = time.time()
et = tstart - tend
print et
Bill
--
INTERNET: bill at Celestial.COM Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
``Lord, the money we do spend on Government and it's not one bit better
than the government we got for one third the money twenty years ago.''
Will Rogers
More information about the freebsd-questions
mailing list