-
Notifications
You must be signed in to change notification settings - Fork 3
/
ada-real_time.ads
143 lines (102 loc) · 3.77 KB
/
ada-real_time.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
-- Standard Ada library specification
-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
package Ada.Real_Time is
type Time is private;
Time_First : constant Time;
Time_Last : constant Time;
Time_Unit : constant := implementation_defined;
type Time_Span is private;
Time_Span_First : constant Time_Span;
Time_Span_Last : constant Time_Span;
Time_Span_Zero : constant Time_Span;
Time_Span_Unit : constant Time_Span;
Tick : constant Time_Span;
function Clock return Time;
function "+" (Left : in Time;
Right : in Time_Span)
return Time;
function "+" (Left : in Time_Span;
Right : in Time)
return Time;
function "-" (Left : in Time;
Right : in Time_Span)
return Time;
function "-" (Left : in Time;
Right : in Time)
return Time_Span;
function "<" (Left : in Time;
Right : in Time)
return Boolean;
function "<=" (Left : in Time;
Right : in Time)
return Boolean;
function ">" (Left : in Time;
Right : in Time)
return Boolean;
function ">=" (Left : in Time;
Right : in Time)
return Boolean;
function "+" (Left : in Time_Span;
Right : in Time_Span)
return Time_Span;
function "-" (Left : in Time_Span;
Right : in Time_Span)
return Time_Span;
function "-" (Right : in Time_Span) return Time_Span;
function "*" (Left : in Time_Span;
Right : in Integer)
return Time_Span;
function "*" (Left : in Integer;
Right : Time_Span)
return Time_Span;
function "/" (Left : in Time_Span;
Right : in Time_Span)
return Integer;
function "/" (Left : in Time_Span;
Right : in Integer)
return Time_Span;
function "abs" (Right : in Time_Span) return Time_Span;
function "<" (Left : in Time_Span;
Right : in Time_Span)
return Boolean;
function "<=" (Left : in Time_Span;
Right : in Time_Span)
return Boolean;
function ">" (Left : in Time_Span;
Right : in Time_Span)
return Boolean;
function ">=" (Left : in Time_Span;
Right : in Time_Span)
return Boolean;
function To_Duration (TS : in Time_Span) return Duration;
function To_Time_Span (D : in Duration) return Time_Span;
function Nanoseconds (NS : in Integer) return Time_Span;
function Microseconds (US : in Integer) return Time_Span;
function Milliseconds (MS : in Integer) return Time_Span;
function Seconds (S : in Integer) return Time_Span;
function Minutes (M : in Integer) return Time_Span;
type Seconds_Count is
range implementation_defined .. implementation_defined;
procedure Split (T : in Time;
SC : out Seconds_Count;
TS : out Time_Span);
function Time_Of (SC : in Seconds_Count;
TS : in Time_Span)
return Time;
private
pragma Import (Ada, Time);
pragma Import (Ada, Time_First);
pragma Import (Ada, Time_Last);
pragma Import (Ada, Time_Span);
pragma Import (Ada, Time_Span_First);
pragma Import (Ada, Time_Span_Last);
pragma Import (Ada, Time_Span_Zero);
pragma Import (Ada, Time_Span_Unit);
pragma Import (Ada, Tick);
end Ada.Real_Time;