Text Timer

I'm a beginner using visual basic only started to learn it about a months ago. I'm having serious trouble at the moment.

I need a program that as soon as it is opened it prints the time into 100ths or miliseconds of seconds, then run the proram and then print the time again just as it ends. (timer at the moment only shows the Time as HH:MM:SS, i want it to show HH:MM:SS:Miliseconds if possible)

For example i open the program and the display on the timer label is prined into Text1 then it runs my loop 10000 times then as soon as it finishes the loop i it to print the time on the timer into Text2.

The reason im doing this is i need to investigate speeds of processors in different machines and prove that the faster the processor the quicker it can complete this loop. Timing by had is just not accurate enough.

1) I cant get the timer to go into hundreths or miliseconds.
2) I cant get the form to print the time on the timer into Text1 When it loads up
3) I cant get my loop to work, i have no idea why haha.
4) I cant get the form to print the time on the timer into Text2 When the loops finished.

Thanks so much for any help you can give, im just totally bamboozled as to how i'm supposed to do this.

I cant get it to work and i have been trying for 2 hours +

thanks again

Frost

P.S I have tried to enclose a screenshot of my program not quite the same as the one above but gives you the idea.

You Need To Add A Plain Ole Standard Module (It's A Good Practice), inside of the module add this:

Module Code:

Public Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Public Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
Public Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

You Need To Add A Plain Ole Standard Module (It's A Good Practice), inside of the module add this:

Module Code:

Public Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Public Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
Public Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Be aware that the time is updated in Windows once every eighteenth of a second. Unless your compiler has a way to access the hardware real time clock outside the Windows I/O period, 1/18 s will be the limit of your resolution.

thanks a million for explaining the use of getsystemtime() .
i was luking for that particular peiece of onfo very badly.
it's really ossom:cool:

vidya

Alright, I've Got It:

You Need To Add A Plain Ole Standard Module (It's A Good Practice), inside of the module add this:

Module Code:

Public Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Public Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
Public Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type