Kevin Klein wrote:
> I am talking of C/C++ on unix platform using gcc. So feel free
> to take off any crossposted NG's if others are not offended,
> but I seek generic C/C++ and also unix and gcc specific answers.
>
> Essentially:
>
> /1/ How do I time a program in seconds or CPU cycles?
Off-topic in all newsgroups you posted to.
Cpu cycles and instruction timing are dependent on the actual
processor. Unix and gcc run on many processors.
> /2/ How do I use the facilities to increase performance of
> any given program?
Use a profiler.
> /3/ CPU has many clocks I have heard. There is also a bus
> clock.
Some have many clocks some have a few. Some may have a separate
bus clock others may have one clock to rule them all.
Again, depends on your processor. For example, the ARM processor
differs in clock cycles from an Intel, Motorola and Signetics
processor. Texas Instruments has different processors that
each have different clock cycles.
> /4/ I looked in a number of books. I found a little on time.h.
> But being humble, I thought I would ask experts as well.
>
[snip]
Ask in a newsgroup about your platform.
You _could_ also try one of the "asm" newsgroups as well as
news:comp.arch.embedded.
>
> Kevin Klein
>
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book