Setting a delay on the system clock

You use the TClock delay functions to set delays. You use TClock::DelayUntil to delay until a specific point in time; you use TClock::DelayFor to delay for a specific amount of time.

To set a delay on a clock, you:

  1. Instantiate a class derived from TTime and a class derived from TClock.
    You instantiate the time class with the time for your delay. DelayUntil delays until the current time on the clock is greater than or equal to your delay time. DelayFor delays until the current time is greater than or equal to the start time plus your delay time.
  2. Call the clock's DelayUntil or DelayFor function to set your delay.
To set delays on the system clock using both DelayFor and DelayUntil:

      THours      delayTime(1);
      TSystemClock realTimeClock;
      // Delay until the current time on the system clock is >= one hour.
      realTimeClock.DelayUntil(delayTime);
      // Delay for one hour from the current time on the system clock.
      realTimeClock.DelayFor(delayTime)

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker