Calculating time of execution

  • Thread starter Thread starter Steve Amey
  • Start date Start date
S

Steve Amey

Hi all

I am using the QueryPerformanceCounter and QueryPerformanceFrequency API's to determine how long it takes to complete methods in my code. Ths is proving useful as it can direct me towards the methods that are taking a while to complete, but I have to put a Begin and End for the counter in every single method block. Eg:

Public Function myFunction()
oTimer.Start
-- Execute the code --
Dim lTime As Double = oTimer.End
End Function

Is there a way in which I can monitor the CallStack of my application and determine from that the length of time it takes to complete the methods in my app? I don't know if this is a ridiculous question, I have not worked with the CallStack or anything like that yet, I just want to find out if there is a way to monitor the execution time for the methods without putting in a call to Start and End for the API's.

Kind Regards,
Steve.
 
There is an *unmanaged* profiling API - so you need to use C++ to properly
use it. There are number of examples if you Google .NET unmanaged profiling
API.

Richard

--
C#, .NET and Complex Adaptive Systems:
http://blogs.geekdojo.net/Richard
Hi all

I am using the QueryPerformanceCounter and QueryPerformanceFrequency API's
to determine how long it takes to complete methods in my code. Ths is
proving useful as it can direct me towards the methods that are taking a
while to complete, but I have to put a Begin and End for the counter in
every single method block. Eg:

Public Function myFunction()
oTimer.Start
-- Execute the code --
Dim lTime As Double = oTimer.End
End Function

Is there a way in which I can monitor the CallStack of my application and
determine from that the length of time it takes to complete the methods in
my app? I don't know if this is a ridiculous question, I have not worked
with the CallStack or anything like that yet, I just want to find out if
there is a way to monitor the execution time for the methods without putting
in a call to Start and End for the API's.

Kind Regards,
Steve.
 
Back
Top