Hey guys!
I have some code that runs on a timer, .Interval = 1000 ms.
Here's the code:
It works fine... It asks the question, waits an hour, counting down the time to next question in Me.Text - like it should.Code:CanTest = CanTest OrElse (DateTime.Now.Subtract(LastTest).Hours >= 1) If CanTest Then If InputBox(Question(Cur), "Question #" & cur.ToString("###,##0")) = Answer(Cur) Then Correct += 1 End If Cur += 1 Else Dim wait As TimeSpan = LastTest.AddHours(1).Subtract(DateTime.Now) Me.Text = "Employee Tester - Waiting " & wait.ToString("mm") & ":" & wait.ToString("ss") End If
However, when I change it to 65 minutes instead of 1 hour, it acts up. The time until next question starts going up instead of down... The only thing I changed is 1 hour to 65 minutes:
Really confused... Please help!Code:CanTest = CanTest OrElse (DateTime.Now.Subtract(LastTest).Minutes >= 65) If CanTest Then If InputBox(Question(Cur), "Question #" & cur.ToString("###,##0")) = Answer(Cur) Then Correct += 1 End If Cur += 1 Else Dim wait As TimeSpan = LastTest.AddMinutes(65).Subtract(DateTime.Now) Me.Text = "Employee Tester - Waiting " & wait.ToString("mm") & ":" & wait.ToString("ss") End If![]()




Reply With Quote