forked from AdaDoom3/AdaDoom3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
neo-library-timers.ads
75 lines (75 loc) · 1.53 KB
/
neo-library-timers.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
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
with
Neo.Foundation.Text_IO,
Neo.Foundation.Data_Types,
Neo.Foundation.Package_Testing;
use
Neo.Foundation.Text_IO,
Neo.Foundation.Data_Types,
Neo.Foundation.Package_Testing;
package Neo.Library.Timers
is
----------------
-- Exceptions --
----------------
Timer_Started_Before_Being_Stopped : Exception;
Timer_Stopped_Without_Being_Started : Exception;
-------------
-- Records --
-------------
type Record_Timer
is private;
-----------------
-- Subprograms --
-----------------
procedure Test;
function Get_Clock_Ticks(
Timer : in Record_Timer)
return Integer_8_Natural;
function Get_Milliseconds(
Timer : in Record_Timer)
return Integer_8_Natural;
procedure Start(
Timer : in Record_Timer);
procedure Stop(
Timer : in Record_Timer);
procedure Sleep_For_Seconds(
Number_Of_Seconds : in Integer_8_Positive);
procedure Sleep_For_Milliseconds(
Number_Of_Milliseconds : in Integer_8_Positive);
function "+"(
Left : in Record_Timer;
Right : in Record_Timer)
return Record_Timer;
function "-"(
Left : in Record_Timer;
Right : in Record_Timer)
return Record_Timer;
-------
private
-------
-------------
-- Records --
-------------
type Record_Timer
is record
Base : Float_8_Natural := 0.0;
Start_Time : Float_8_Natural := 0.0;
Is_Stopped : Boolean := False;
end record;
end Neo.Library.Timers;