I'm using Socket and AStreams in order to make an experiment for my degree.
I need to know how many tenth of secs takes to the user to press a button.
However, i need to check if a delayed time is true or it is due to wi-fi communiction delays.
Is there any way to check it.
Appreciate your help.
regards
mike
I assume that you are testing it in local network. I expect the latency to be quite small and without too much fluctuations.
Create a simple program that sends the current device time every 100ms. On the server side check the difference between the server time and the device time. Is this value consistent?
Yes, it is a local network. I have a log file on VB6 server recording the time data received on a DataArrival and data sent on SendDataComlete events of the winsocket. Is that enough or is there any similar events on socket view or counting CRC data errors on B4A? Where i should put the log time? At the beginning of AStreams_NewData and SendData event? This is an experiment and want to keep track the response time, so i need to check this in whenever the button is pressed. The networks could be different local networks in different offices
You mean to record the time button pressed and the time recorded at the end of SendData event and then to compare them to find the difference? Could you please elaborate it ?
There is an experiment. There are questions sent by the server and the possible anwers as well. The answes are the buttons. so when the client receives the data, they are shown to the user (questions and answers. I need to record the user's response time. This experiment is related to my final assesment on my studies and part of my dissertation.
Αt the moment, i record the time when the server receives the number of question pressed and save them in an Excel sheet, so I need to know if there is a delay in transmitting.
regards, mike
Yes it is a solution but have to make changes to the Server/Clients code and need it on Monday, so not sure if I will have make it working ok.
In VB I have 3 timers one for tenth of sec another for seconds and another for minutes. The result store in tenth of secs and then I re-translate
to min, sec, thenth.
If I initialise a timer1.initiliaze("timer1",100) in order to counts tenth of secs and then
to enable it when the buttons appears to the user and disable it when the user push a button
Then send the number of question answered and then the amount of time to the server in tenth of secs and then repeat the same in every new question
and then to use this code on the server to extract min/secs/tenths
B4X:
Function TotTime_to_MinSecTen(ByVal tobconvert As Double) As String
Dim minutes, seconds, tenths As Integer
Dim newstringTime As String
If tobconvert < 600 Then
minutes = 0
remaining = tobconvert
Else
minutes = tobconvert \ 600
remaining = tobconvert Mod 600
End If
tobconvert = remaining
If tobconvert < 10 Then
seconds = 0
remaining = tobconvert
Else
seconds = tobconvert \ 10
remaining = tobconvert Mod 10
End If
tenths = remaining
TotTime_to_MinSecTen = Str$(minutes) & ":" & Str$(seconds) & ":" & Str$(tenths)
End Function
Could you give me a hand on how to initialise repeatedly the timer (in every new question), to reset it and to get a fixed value in thenth of secs?
(have no time to experiment with it to make work on this monday)?