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,51aec3e725649fde X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-04 10:56:15 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: rtcoslet@rockwellcollins.com (R. Tim Coslet) Newsgroups: comp.lang.ada Subject: Re: Fairly simple question about using time in Ada Date: 4 Oct 2001 10:56:14 -0700 Organization: http://groups.google.com/ Message-ID: References: <3bb5234f$0$9274$afc38c87@news.optusnet.com.au> NNTP-Posting-Host: 205.175.225.23 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1002218175 26158 127.0.0.1 (4 Oct 2001 17:56:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 4 Oct 2001 17:56:15 GMT Xref: archiver1.google.com comp.lang.ada:13730 Date: 2001-10-04T17:56:15+00:00 List-Id: "Chris Vinall" wrote in message news:<3bb5234f$0$9274$afc38c87@news.optusnet.com.au>... > I'm writing a program in which I need to be able to timestamp events and > then later check how much real time has elapsed since that event occurred. > It is essential that this timing operate to tenths of a second and > hundredths of a second would be a lot better. > > How do I go about doing this in Ada? My textbook mentioned something about > Duration but was less than helpful. > > Thanks for any help > > Chris See D.8(7) To correctly do time stamping you need the package Ada.Real_Time The constant Tick gives the timing accuracy of your implementation of this package. You would call the function Clock to get the current Time for use in generating your time stamps. Please note that other posters have not differentatiated between the accuracy of a number and the precision of a number. They are different! What you need for good time stamps is accuracy (fidelity to reality), not precision (number of bits or digits used to represent the value).