PR testsuite/64850
[official-gcc.git] / gcc / ada / a-exetim.ads
blob1dc5f61f9c0e8577d87c9171860db8cc435f3b43
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- A D A . E X E C U T I O N _ T I M E --
6 -- --
7 -- S p e c --
8 -- --
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. --
13 -- --
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
18 -- environments.
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;
25 with Ada.Real_Time;
27 package Ada.Execution_Time is
28 pragma Preelaborate;
30 pragma Unimplemented_Unit;
32 type CPU_Time is private;
34 CPU_Time_First : constant CPU_Time;
35 CPU_Time_Last : constant CPU_Time;
36 CPU_Time_Unit : constant := 0.000001;
37 CPU_Tick : constant Ada.Real_Time.Time_Span;
39 function Clock
40 (T : Ada.Task_Identification.Task_Id :=
41 Ada.Task_Identification.Current_Task)
42 return CPU_Time;
44 function "+"
45 (Left : CPU_Time;
46 Right : Ada.Real_Time.Time_Span) return CPU_Time;
48 function "+"
49 (Left : Ada.Real_Time.Time_Span;
50 Right : CPU_Time) return CPU_Time;
52 function "-"
53 (Left : CPU_Time;
54 Right : Ada.Real_Time.Time_Span) return CPU_Time;
56 function "-"
57 (Left : CPU_Time;
58 Right : CPU_Time) return Ada.Real_Time.Time_Span;
60 function "<" (Left, Right : CPU_Time) return Boolean;
61 function "<=" (Left, Right : CPU_Time) return Boolean;
62 function ">" (Left, Right : CPU_Time) return Boolean;
63 function ">=" (Left, Right : CPU_Time) return Boolean;
65 procedure Split
66 (T : CPU_Time;
67 SC : out Ada.Real_Time.Seconds_Count;
68 TS : out Ada.Real_Time.Time_Span);
70 function Time_Of
71 (SC : Ada.Real_Time.Seconds_Count;
72 TS : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero)
73 return CPU_Time;
75 Interrupt_Clocks_Supported : constant Boolean := False;
76 Separate_Interrupt_Clocks_Supported : constant Boolean := False;
78 function Clock_For_Interrupts return CPU_Time;
80 private
82 type CPU_Time is new Ada.Real_Time.Time;
84 CPU_Time_First : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_First);
85 CPU_Time_Last : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_Last);
87 CPU_Tick : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Tick;
89 end Ada.Execution_Time;