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,ffa5a82d3c57141e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-12 10:26:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Help - time to string query Date: Thu, 12 Dec 2002 12:26:14 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:31758 Date: 2002-12-12T12:26:14-06:00 List-Id: Toshitaka Kumano wrote in message ... >SteveD wrote: >> Float_Text_Io.Put( Float( Ada.Real_Time.To_Duration( end_Time - >> Start_TIme ) ), 3, 5, 0 ); >> Text_Io.New_Line; > >OR simply, > >... use Ada.Real_Time; >Text_IO.Put_Line (Duration'Image (To_Duration (end_Time - Start_TIme))); > >-- If converting to float, you might lose precision. Right. And if you care about the formatting, use an instantiation of Fixed_IO (then you won't lose precision either): package Dur_IO is new Ada.Text_IO.Fixed_IO(Duration); ... Dur_IO.Put (Ada.Real_Time.To_Duration (End_Time - Start_Time ), 3, 5, 0 ); It's the same number of lines, after all (as we're replacing the "with Float_Text_IO;" by the instantiation). Randy.