Re: Real Time IO routines
- From: anon@xxxxxxxx (anon)
- Date: Sat, 27 Oct 2007 08:56:42 GMT
--
-- Simple answer is to build a IO package and use Unchecked_Conversion
--
with Ada.Real_Time ;
with Ada.Text_IO ;
--
--
--
use Ada.Real_Time ;
use Ada.Text_IO ;
with Ada.Unchecked_Conversion ;
procedure z is
--
-- I/O Time ( Duration ) type.
--
package D_IO is new Ada.Text_IO.Fixed_IO ( Duration ) ;
--
-- convert Ada.Real_Time private Time to a local type.
--
function To_Duration is new Ada.Unchecked_Conversion
( Time, Duration ) ;
Time_Value : Time ;
begin
Time_Value := Clock ;
Put ( "Time := " ) ;
D_IO.Put ( To_Duration ( Time_Value ) ) ;
New_Line ;
end z ;
In <1193410739.367181.96050@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, andrew <andrew.carroll@xxxxxxxxxxx> writes:
Hello,
Is there a put or put_line procedure to output the value of variables
declared as the Time type defined in the Real_Time package?
.
- Follow-Ups:
- Re: Real Time IO routines
- From: Dmitry A. Kazakov
- Re: Real Time IO routines
- References:
- Real Time IO routines
- From: andrew
- Real Time IO routines
- Prev by Date: Re: Real Time IO routines
- Next by Date: Re: Real Time IO routines
- Previous by thread: Re: Real Time IO routines
- Next by thread: Re: Real Time IO routines
- Index(es):
Relevant Pages
|