snufse
Newcomer
I am using the following code to get the elapsed time for a process. The difference is calculated and added to a list box. On first pass the difference in time is calculated and on all subsequent passes elapsed time shows as zero?
Here is the code:
Do
Dim FromTime As DateTime = DateTime.Now
... Here goes the code wich is a call to a stored procedure ....
Dim ToTime As DateTime = DateTime.Now
Dim TimeDifference As TimeSpan = ToTime.Subtract(FromTime)
Dim DifferenceInMilliseconds As Double = TimeDifference.TotalMilliseconds
ListBox1.Items.Add("Processing Time: " & DifferenceInMilliseconds.ToString & " ms")
Loop
Here is the code:
Do
Dim FromTime As DateTime = DateTime.Now
... Here goes the code wich is a call to a stored procedure ....
Dim ToTime As DateTime = DateTime.Now
Dim TimeDifference As TimeSpan = ToTime.Subtract(FromTime)
Dim DifferenceInMilliseconds As Double = TimeDifference.TotalMilliseconds
ListBox1.Items.Add("Processing Time: " & DifferenceInMilliseconds.ToString & " ms")
Loop