clock time in milliseconds into a c program

Marco Trentini mark at remotelab.org
Fri Jan 21 14:22:13 PST 2005


On Wed, Jan 19, 2005 at 08:12:13PM -0600, Ryan Sommers wrote:
> Marco Trentini wrote:
> >Hi, I need to clock the function execution time into a C
> >program. I know /usr/include/time.h library but I need to
> >clock the time in milliseconds.
> >
> >Any suggestions, links?
> >
> 
> Are you looking for how long the processor spent executing your code? Or 
> the difference in wall time between when it enters the function and when 
> it exits the function?

Second one. I need to clock (in a freely way) how long few
linear algebraic functions spent computing the solution. I
understand your observations on this topic.  Anyway the
gettimeofday's solution is good for me, thanks all.

-- 
Marco Trentini                mark at remotelab.org
http://www.remotelab.org/


More information about the freebsd-hackers mailing list