rachayita jaiswal

rachayita jaiswal

  • NA
  • 217
  • 106.3k

Time stamp in VB.Net

Jul 18 2013 7:56 AM
Hi, I have used time stamp in vb.net like this - 

btnGenerateReport.Enabled = False
            Dim sw As Stopwatch = Stopwatch.StartNew()

getreport() */ this is my function through ehich i am loading data

sw.Stop()
            Dim ts As TimeSpan = sw.Elapsed
            Label1.Text = ts.TotalMilliseconds.ToString() + " ms for summary report"

now i am getting time in milliseconds in my label

but each time milliseconds are different means first time it is "3392.2505 ms"
and same code when i run second time it is "3696.0097 ms".

it should be same....

Please tell me is there ant error in my code or why it is different each time???

Thanks


Answers (3)