$20 to anyone that can fix my program the way I need
Ive worked for hours on this crap program, It measures your reaction time, and then displayed it in a message box. Ill put the code on medifire anybody with any coding skill at all should be in for a quick 20 bucks via paypal.
http://image.bayimg.com/balimaadh.jpg
The test needs to run 5 times with a while loop (click button wait for green circle display reaction time in message box) then display the 5 tests from a array in the text box and average them.
here are the files from vb
reaction! VB files
Re: $20 to anyone that can fix my program the way I need
Re: $20 to anyone that can fix my program the way I need
Moved to the Project Request Forum.
Gary
1 Attachment(s)
Re: $20 to anyone that can fix my program the way I need
I would not test your time between the timer2 whit a increment.
Instead i would have made 2 variable.
Starttime as date
endtime as date
And test the time diff between them.
Edit: remove the file.. and read the message again. See i read it all wrong sorry
Well i would just print the text out each time the user pressed a button and make a counter for each time timer1 activate it again.
Stop your timer1 when it reach the 5 times.
Then have variable saving stats like fastest time and slowest time.
Then print these out in the message box when it ends.
That was what i was trying to do in my vb6 project.
Edit: Well i edit again and made it work in vb6.
It show result, in text window whit fastet and slowest. Any other data can be added.
i made so you can choise more than 5 or less
1 Attachment(s)
Re: $20 to anyone that can fix my program the way I need
Please go through the comments in the VB file that I have attached.
Instead of using another Timer to find out the time taken, you could store the starting time and then find the difference using a TimeSpan. It's more flexible.
:wave:
Re: $20 to anyone that can fix my program the way I need
I like that the vb 2010 ver has "ts.TotalMilliseconds" i saw it in some code on the net but couldent find a way for vb6
Re: $20 to anyone that can fix my program the way I need
Quote:
Originally Posted by
snortop
I like that the vb 2010 ver has "ts.TotalMilliseconds" i saw it in some code on the net but couldent find a way for vb6
You could use the GetTickCount() API in VB6. :)
Example:
vb Code:
Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim lngStart As Long
Dim lngEnd As Long
Private Sub Command1_Click()
'~~~ Start
lngStart = GetTickCount
End Sub
Private Sub Command2_Click()
'~~~ End
lngEnd = GetTickCount
'~~~ Result
Dim lngResult As Long
lngResult = lngEnd - lngStart
MsgBox CStr(lngResult) & " milliseconds"
End Sub
:wave:
Re: $20 to anyone that can fix my program the way I need
Well i kind of solved it myself in a diffent way.
It was in the code i posted, just wanted to mention had a bid of problem finding a solution :D
Code:
Public Function MyTimeReturnMillisec(TimeCheck As Date) As String
Dim Min As Integer
Dim timetekst As String
timetekst = "0"
' Didnt want to go above 1 hours!!
If Hour(TimeCheck) > 1 Then
MyTimeReturnMillisec = -1
Exit Function
End If
If Minute(TimeCheck) > 0 Then
timetekst = Val(timetekst) + ((Minute(TimeCheck) * 60) * 100)
End If
If Second(TimeCheck) > 0 Then
timetekst = Val(timetekst) + (Second(TimeCheck) * 60)
End If
' Here i get the millisec
Min = Format(TimeShow, "ss") & Right(Format(Timer, "#0.00"), 2)
timetekst = Val(timetekst) + Min
MyTimeReturnMillisec = timetekst
End Function
But if the code can be improved it some have... maybe make a post "code it better"
So posted it her
Edit:
But looking at your code seem like a much better way anyway.