Avatar of arthurh88
arthurh88
 asked on

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

Avatar of undefined
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
ASKER CERTIFIED SOLUTION
atomsheep

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Rick Hobbs

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
arthurh88

ASKER
looks good!  thanks
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy