1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . E X E C U T I O N _ T I M E --
9 -- This specification is derived from the Ada Reference Manual for use with --
10 -- GNAT. In accordance with the copyright of that document, you can freely --
11 -- copy and modify this specification, provided that if you redistribute a --
12 -- modified version, any changes that you have made are clearly indicated. --
14 ------------------------------------------------------------------------------
16 -- This unit is not implemented in typical GNAT implementations that lie on
17 -- top of operating systems, because it is infeasible to implement in such
20 -- If a target environment provides appropriate support for this package
21 -- then the Unimplemented_Unit pragma should be removed from this spec and
22 -- an appropriate body provided.
24 with Ada
.Task_Identification
;
27 package Ada
.Execution_Time
with
32 pragma Unimplemented_Unit
;
34 type CPU_Time
is private;
36 CPU_Time_First
: constant CPU_Time
;
37 CPU_Time_Last
: constant CPU_Time
;
38 CPU_Time_Unit
: constant := 0.000001;
39 CPU_Tick
: constant Ada
.Real_Time
.Time_Span
;
41 use type Ada
.Task_Identification
.Task_Id
;
44 (T
: Ada
.Task_Identification
.Task_Id
:=
45 Ada
.Task_Identification
.Current_Task
)
49 Global
=> Ada
.Real_Time
.Clock_Time
,
50 Pre
=> T
/= Ada
.Task_Identification
.Null_Task_Id
;
54 Right
: Ada
.Real_Time
.Time_Span
) return CPU_Time
59 (Left
: Ada
.Real_Time
.Time_Span
;
60 Right
: CPU_Time
) return CPU_Time
66 Right
: Ada
.Real_Time
.Time_Span
) return CPU_Time
72 Right
: CPU_Time
) return Ada
.Real_Time
.Time_Span
76 function "<" (Left
, Right
: CPU_Time
) return Boolean with
78 function "<=" (Left
, Right
: CPU_Time
) return Boolean with
80 function ">" (Left
, Right
: CPU_Time
) return Boolean with
82 function ">=" (Left
, Right
: CPU_Time
) return Boolean with
87 SC
: out Ada
.Real_Time
.Seconds_Count
;
88 TS
: out Ada
.Real_Time
.Time_Span
)
93 (SC
: Ada
.Real_Time
.Seconds_Count
;
94 TS
: Ada
.Real_Time
.Time_Span
:= Ada
.Real_Time
.Time_Span_Zero
)
99 Interrupt_Clocks_Supported
: constant Boolean := False;
100 Separate_Interrupt_Clocks_Supported
: constant Boolean := False;
102 pragma Warnings
(Off
, "check will fail at run time");
103 function Clock_For_Interrupts
return CPU_Time
with
105 Global
=> Ada
.Real_Time
.Clock_Time
,
106 Pre
=> Interrupt_Clocks_Supported
;
107 pragma Warnings
(On
, "check will fail at run time");
110 pragma SPARK_Mode
(Off
);
112 type CPU_Time
is new Ada
.Real_Time
.Time
;
114 CPU_Time_First
: constant CPU_Time
:= CPU_Time
(Ada
.Real_Time
.Time_First
);
115 CPU_Time_Last
: constant CPU_Time
:= CPU_Time
(Ada
.Real_Time
.Time_Last
);
117 CPU_Tick
: constant Ada
.Real_Time
.Time_Span
:= Ada
.Real_Time
.Tick
;
119 end Ada
.Execution_Time
;