Newbie Programmer here looking for advice: I have a small app that checks a sorted array with a date/time field as a "trigger" (only 3 records entered to test).

Thing is, while this "check loop" is running it may be too simple to be practical - the app eats up CPU cycles while just "checking" for the next trigger time, which could be set for hours or days away.

Is there a more efficient way to program this? Like a "sleep time" function or a better known method for "checking" only once a minute or so? (Even "high level" advice would be appreciated.) Thanks!

ex:

Code:
X = 0
Do While X <> 3
   Y = X
   Do While Y = X
      If Date.Now > TableData(X).TriggerDateTime Then
          [Action Code]
          X = X + 1
      End If
   Loop
Loop
---------------
ENV
mailto:[email protected]