comp.lang.ada
 help / color / mirror / Atom feed
From: Toshitaka Kumano <kumano@cl.cilas.net>
Subject: Re: Help - time to string query
Date: Fri, 13 Dec 2002 00:42:05 +0900
Date: 2002-12-13T00:42:05+09:00	[thread overview]
Message-ID: <mailman.1039707663.24707.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: EJTJ9.24550$hw3.6051@sccrnsc04

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. 


OR if you prefer somewhat "current" time than relative time_span, 

... use Ada.Real_Time;
Text_IO.Put_Line (Duration'Image (To_Duration (Clock - Time_First)));

-- This shows total time_span since "epoch".
-- In this case, because the time_span value may be rather large,
-- in some compilers (e.g. GNAT), you may lose precision in Duration'Image().

-- 
Toshitaka Kumano
Kamakura, Japan



  reply	other threads:[~2002-12-12 15:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11  8:30 Help - time to string query TAMS Team
2002-12-12  3:52 ` SteveD
2002-12-12 15:42   ` Toshitaka Kumano [this message]
2002-12-12 18:26     ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2002-12-11  8:48 Grein, Christoph
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox