473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Calculating time of execution

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.
Jul 21 '05 #1
1 1459
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
"Steve Amey" <stevea@centurion-ms_RemoveThis_.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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.
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ron Adam | last post by:
Hi, I'm having fun learning Python and want to say thanks to everyone here for a great programming language. Below is my first Python program (not my first program) and I'd apreciate any...
0
by: Kasp | last post by:
Hi there, I am trying to make an OLAP cube on a table having two columns (datetime, Number_of_times_an_event_occured). My dimension is time and I want to measure the Min and Max times an event...
2
by: Eric Whittaker | last post by:
here's my dilemma, on the program below, i am trying to calculate overtime pay at time and a half, but instead of only counting the hours after 40, it counts all hrs at that rate, how can i avoid...
1
by: jlm | last post by:
I have a form which feeds table (TblEmpLeave) of Employee Leave Time (time taken off for Administrative, Annual, Sick, Compensation leave). I have EmpID, LeaveDate, LeaveType, LeaveHours fields on...
1
by: Steve Amey | last post by:
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...
7
by: Curious | last post by:
Hi, I have created my own data structure. Basically it is a two way 'stack', where I can push elements and pop elements both from top and bottom. I also included a counter to show the number...
3
by: psbasha | last post by:
Hi, I would like to know the time taken by each function,for an application.Other than profiler ,is there any method/function available to print the duration of execution of method/function. ...
25
by: Umesh | last post by:
i want to calculate the time required to execute a program. Also i want to calcute the time remaining for the execution of the program. how can i do that? pl mention some good websites for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.