المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Measure timing of functions



C++ Programming
04-16-2009, 04:58 AM
I have a C/C++ program (yes, a mix of both) that acquires data from a hardware device and displays it in real time. I want to add some processing on the data as soon as I read it, but I want to make sure it doesn't slow down the data acquisition too much. Is there a utility that will measure how long a function takes or how often it is called?

I already use the Red Gate ANTS profiler for my .NET apps, but it doesn't work with native code. Also, any profilers I've tried tend to slow down the application quite a bit. Is there a way I can measure the execution time without affecting it too?

Or would it be best to use the clock() function from time.h to measure this?

Thanks,

Dybs