Solved

Debug Execution Time for Each Line of Code

Posted on 2009-07-15
2
208 Views
Last Modified: 2013-11-26
Hello,

I've written an application in vb.net 2005 which loads a table from SQL server and then fills a table with the data.
Its now in a production environment for testing and its very slow at filling the table.
It isnt slow to load the data from the server because i've put in a message box to tell me when the .Fill has finished execution. It is slow to fill the table.

(sub-note: I have a treeview control and have to scan the tree to see if it contains a "parent". If doesn't exist then either a new parent node is added to the tree, or if a parent is found, a "child" is place under that parent. I believe it is the for..loop which is slow)

I'd like to run the code and receive a list of all the code and a measurement by each line telling me how long it took to execute.

I dont want to use the Timer method (i.e.storing the start time of the code and using the end time to work out the total execution time). This would be impractical as I need to do this for every line of code.

I'd prefer a piece of debugging software, that has a free-trial or is free :-)
Or something that's built into visual studio.

Many thanks
Dan
0
Comment
Question by:DanJourno
2 Comments
 
LVL 11

Accepted Solution

by:
azarc3 earned 500 total points
ID: 24862850
If you're running Visual Studio 2005 Team System then use the Profiler. If not, then the best of breed tool is NCover... which is unfortunately very expensive. If you've got the budget for either, I would suggest NCover but also go with either VS 2005 Team Edition for Software Developers...

There's an open source tool, PartCover, which I have no experience with at all. It also concerns me that the tool appears to come out of Eastern Europe without offering a source code that I can build for myself to make sure it's not doing anything crazy behind the covers.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What's the most efficient way to load up a couple of large table in C#? 5 33
Error on Add method 1 37
Close tabpage of custom control 9 23
Help with AsEnumerable(), LINQ 4 20
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
A short film showing how OnPage and Connectwise integration works.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now