Support Forums
help with vb codes - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: help with vb codes (/showthread.php?tid=3800)



help with vb codes - borowest - 12-20-2009

need visual basic codes that calculate the elapsed time


RE: help with vb codes - Extasey - 12-20-2009

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


RE: help with vb codes - Revenger - 12-20-2009

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.


RE: help with vb codes - thanasis2028 - 12-21-2009

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