473,382 Members | 1,639 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,382 software developers and data experts.

Figureing out how long a sub takes to execute

I want to time how long a specific sub takes to execute, what is the best
way to do this? this is only for one sub, and i just need a result back in
milliseconds or such to display to a user. thanks!
Nov 21 '05 #1
2 984
this will do the trick
Dim substart As DateTime = Now

'some code here

MsgBox("pause") 'just for testing
Dim elapsed_time As TimeSpan
Dim subEnd As DateTime = Now
elapsed_time = subEnd.Subtract(substart)

MsgBox(elapsed_time.TotalMilliseconds())

regards

Michel Posseth

"Brian Henry" wrote:
I want to time how long a specific sub takes to execute, what is the best
way to do this? this is only for one sub, and i just need a result back in
milliseconds or such to display to a user. thanks!

Nov 21 '05 #2
"Brian Henry" <no****@nospam.com> schrieb:
I want to time how long a specific sub takes to execute, what is the best
way to do this? this is only for one sub, and i just need a result back in
milliseconds or such to display to a user.


<URL:http://www.mentalis.org/soft/class.qpx?id=8>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

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

Similar topics

7
by: Damien | last post by:
Hello to all, I've written a script that take quite a long time to execute (email sending). Last time I ran it, PHP gave me a "execution time limit exceeded" (or something like that), so I changed...
2
by: serge calderara | last post by:
Dear all, I have a simple class in my application whcih create dynamically textbox control to be place on a form When I execute the code : log(time) my control = new myclass() log (time)
4
by: Kurt | last post by:
Hi I am using CDO 1.21 from C# in order to iterate through the entries in a users outlook address book (as OOM was too slow). Basically I take the Name field from each "message" and insert it into...
2
by: Zri Man | last post by:
I have a situation that is as follows: First an Index of what is discussed below: FED_A ->> Federated Objected/Table that has lots of rows LOC_B ->> Local Table which is selected and...
4
by: Steve Teeples | last post by:
I am calling the method GetInstances() within the ManagementClass. I have 48 applications on my system. Mearly calling the routine takes 28 seconds for it to return. I don't understand why this...
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
4
by: prashanth | last post by:
we have a Asp.net application which is used to generate the reports. In this application there are some reports which takes more than 50 minutes of the time.these reports works fine on development...
2
by: vpai | last post by:
We have a package in production which has suddenly started consuming greater than normal time to execute. On debugging this further, we found the following: The package takes 5 mins to come out. ...
6
by: Charles Law | last post by:
I have a data table with ~1000 rows. I go through the rows one at a time, checking the contents. If I find a cell with an error, e.g containing null, I use SetColumnError on the data row to flag...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.