how do I "do nothing" for 10 minutes? VB.NET
If counter > 70 Then
<CODE TO TRIGGER DOING NOTHING FOR 10 MINUTES>
counter = 0
End If
This code above is inside a nested loop.
When counter is more than 70, I need to pause the program (without loading my CPU) and just do nothing for 10 minutes. No further code is executed. I have a timer in my program but I dont know the code to put here.
Visual Basic.NET
Last Comment
arthurh88
8/22/2022 - Mon
atomsheep
Try:
If counter > 70 then
Timer1.interval = 10000
Timer1.enabled = true
End If
Then, in the Timer1_Tick event, you would then have your counter = 0 code.
Not sure how to stop other code for executing in these 10 minutes though - perhaps disabling the GUI would prevent user interaction during this time?
arthurh88
ASKER
the problem is that i dont know how to do that without my CPU going to 100%...basically "loop endlessly until the timer reaches 10000" which is a 100% hit on my CPU
If counter > 70 then
Timer1.interval = 10000
Timer1.enabled = true
End If
Then, in the Timer1_Tick event, you would then have your counter = 0 code.
Not sure how to stop other code for executing in these 10 minutes though - perhaps disabling the GUI would prevent user interaction during this time?