Support Forums

Full Version: help with vb codes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
need visual basic codes that calculate the elapsed time
Shouldn't be too hard.
What are you making and how much experience do you have?
I CBF to write them, i'll have a look around though.
Is this what you mean?
http://support.microsoft.com/kb/213481
You mean from when you started the application to when you finished it?

If that's what you're talking about, then just make a new timer with an interval of 1000, and enable it.

Create a new module and add:
Code:
Public lapsedTime As Int = 0

Double click on the timer and add this:
Code:
lapsedTime = lapsedTime + 1

Every second, lapsedTime will get added by 1 from the time the application was ran. You can format that however you like.
I'ts very easy, although I only found out about it a few days ago
Code:
dim a as new stopwatch()
a.start()
'do whatever you want
msgbox(a.elapsedmillisecons) 'milliseconds passed since start

a.stop()'to pause it any time
a=new stopwatch() 'to reset it