troubleshooting Question


Avatar of dchau12
dchau12 asked on
Visual Basic.NET
2 Comments2 Solutions213 ViewsLast Modified:
I want to run a process after every 15 minutes.  Here is the code i have so far:
       Dim a As Date
        a = Now
        Dim f As Integer
      While 1
            a = Now
            If a.Minute Mod 15 = 0 And f = 0 Then
                f = 1
            End If

            If a.Minute Mod 15 = 1 Then
                f = 0
            End If

        End While

Is this the best way to kick off a process that will run every 15 minutes?  It looks like it takes up a lot of processor resources just spinning through that while loop.  Is there a way to put the program into a sleep mode for a specified amount of time before it fires off another event?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros