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,350a90791b49a5b1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-30 14:36:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!demon!diablo.theplanet.net!news.theplanet.net!not-for-mail From: "Des Walker" Newsgroups: comp.lang.ada Subject: Re: Time to float?? Date: Sun, 30 Sep 2001 22:36:48 +0100 Message-ID: <9p838f$2fl$1@newsg1.svr.pol.co.uk> References: <3BB78935.33B5C91A@ida.his.se> NNTP-Posting-Host: modem-232.carbon.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: newsg1.svr.pol.co.uk 1001885775 2549 62.136.5.232 (30 Sep 2001 21:36:15 GMT) NNTP-Posting-Date: 30 Sep 2001 21:36:15 GMT X-Complaints-To: abuse@theplanet.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Xref: archiver1.google.com comp.lang.ada:13561 Date: 2001-09-30T21:36:15+00:00 List-Id: Michael Andersson wrote in message news:3BB78935.33B5C91A@ida.his.se... > Hi! > Could somebody please show me how to convert Ada.Real_time type Time to > a float so that for example 1.5 seconds is represented as the real > number 1.5. > > Thanks! > /Michael Andersson I wonder if what you want is to convert a Time_Span type rather than a Time type value. A value of type Time is more likely to be a form of '10:21pm, 30 September 2001', and a Time_Span type a form of 1.5 seconds. (Subtract two Ada.Real_Time.Time values and the function provided in the Ada.Real _Time package provides an Ada.Real_Time.Time_Span type value) Ada.Real_Time provides the To_Duration function to convert an Ada.Real_Time.Time_Span value to a Duration. You can cast this to a real floating type, or you can use Duration'Image if you're printing the result. Regards Des Walker