From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,62bdda29a43a63dd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-10 09:04:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!sn-xit-05!sn-xit-06!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Jeffrey D. Cherry" Newsgroups: comp.lang.ada Subject: Re: Delay Date: Wed, 10 Jul 2002 16:01:20 -0000 Organization: Northrop Grumman Message-ID: References: <3D2C3CE1.1080501@yahoo.com> User-Agent: Xnews/4.11.09 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:26989 Date: 2002-07-10T16:01:20+00:00 List-Id: David Rasmussen wrote in news:3D2C3CE1.1080501 @yahoo.com: > How do I make a delay in an Ada program? > > /David > Use the 'delay' statement. Refer to section 9.6 of the Ada Reference Manual. >From section 9.6 of the Ada RM: "A delay_statement is used to block further execution until a specified expiration time is reached. The expiration time can be specified either as a particular point in time (in a delay_until_statement), or in seconds from the current time (in a delay_relative_statement)." Examples from that same section: "Example of a relative delay statement: delay 3.0; -- delay 3.0 seconds Example of a periodic task: declare use Ada.Calendar; Next_Time : Time := Clock + Period; -- Period is a global constant of type Duration begin loop -- repeated every Period seconds delay until Next_Time; ... -- perform some actions Next_Time := Next_Time + Period; end loop; end;" Note that the data type of the delay expression (the value appearing after the reserved word 'delay') differs in the two forms of the delay statement. The relative delay accepts a delay expression of type duration (a standard data type) while the delay until accepts a value of some "time" type. The example above shows that the delay until uses the data type "Time" defined in the standard package Ada.Calendar. Hope that helps! -- Regards, Jeffrey D. Cherry Senior IV&V Analyst Northrop Grumman Information Technology