Simple question: How to find Elapsed time (in seconds)

B

Bill Nguyen

I need to display elapsed time for a process in VB.NET in secods.
What's the routine to do this?
Thanks

Bill
 
T

tommaso.gastaldi

How about something simple like:

Dim StartTime As DateTime = Now

'Any processing here ...

ElapsedTime = Now.Subtract(StartTime).TotalSeconds
Dim ElapsedTime As Double =
Now.Subtract(StartTime).TotalSeconds
MsgBox("Elapsed seconds: " & ElapsedTime,
MsgBoxStyle.Information)

-tom

Bill Nguyen ha scritto:
 
B

Bill Nguyen

Works great!
Thanks Tomaso!

Bill

How about something simple like:

Dim StartTime As DateTime = Now

'Any processing here ...

ElapsedTime = Now.Subtract(StartTime).TotalSeconds
Dim ElapsedTime As Double =
Now.Subtract(StartTime).TotalSeconds
MsgBox("Elapsed seconds: " & ElapsedTime,
MsgBoxStyle.Information)

-tom

Bill Nguyen ha scritto:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top