I'm doing a software analysis assignemnt which requires me to deal with visual basic. I've never used the language before.
I have a loop which I would like to calucate the time taken to complete the loop.
Any heads up guys? I want something very simple.
2 Months Ago
Related Article:Table Adapter Connection Timeout
is a VB.NET discussion thread by steveh000 that has 2 replies, was last updated 11 months ago and has been tagged with the keywords: vb, tableadapter, timeout, database.
Ok, maybe this will help....I am guessing it is .net.
Dim stpWatchInfo As New System.Diagnostics.Stopwatch 'place this in the global decoration area
stpWatchInfo.Start()'place this in the loop beginning
'place the following right after the loop is done
dim tmr as long' just a variable to hold the amount of time it took
tmr = stpWatchInfo.Elapsed.TotalSeconds 'this is the number of seconds the loop took
tmr = stpWatchInfo.Elapsed.TotalMilliseconds 'this is the number of milliseconds the loop took
Keep in mind the stopwatch will slow down your loop by a small amount of time. This should give you a baseline of how long the loop is taking.