]>
Commit | Line | Data |
---|---|---|
c7de829c WD |
1 | /**************************************************************************** |
2 | * | |
3 | * Ultra Long Period Timer | |
4 | * | |
5 | * ======================================================================== | |
6 | * | |
7 | * The contents of this file are subject to the SciTech MGL Public | |
8 | * License Version 1.0 (the "License"); you may not use this file | |
9 | * except in compliance with the License. You may obtain a copy of | |
10 | * the License at http://www.scitechsoft.com/mgl-license.txt | |
11 | * | |
12 | * Software distributed under the License is distributed on an | |
13 | * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | |
14 | * implied. See the License for the specific language governing | |
15 | * rights and limitations under the License. | |
16 | * | |
17 | * The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc. | |
18 | * | |
19 | * The Initial Developer of the Original Code is SciTech Software, Inc. | |
20 | * All Rights Reserved. | |
21 | * | |
22 | * ======================================================================== | |
23 | * | |
24 | * Language: ANSI C | |
25 | * Environment: *** TODO: ADD YOUR OS ENVIRONMENT NAME HERE *** | |
26 | * | |
27 | * Description: OS specific implementation for the Zen Timer functions. | |
28 | * | |
29 | ****************************************************************************/ | |
30 | ||
31 | /*----------------------------- Implementation ----------------------------*/ | |
32 | ||
33 | /**************************************************************************** | |
34 | REMARKS: | |
35 | Initialise the Zen Timer module internals. | |
36 | ****************************************************************************/ | |
37 | void _ZTimerInit(void) | |
38 | { | |
8bde7f77 | 39 | /* TODO: Do any specific internal initialisation in here */ |
c7de829c WD |
40 | } |
41 | ||
42 | /**************************************************************************** | |
43 | REMARKS: | |
44 | Start the Zen Timer counting. | |
45 | ****************************************************************************/ | |
46 | static void _LZTimerOn( | |
47 | LZTimerObject *tm) | |
48 | { | |
8bde7f77 WD |
49 | /* TODO: Start the Zen Timer counting. This should be a macro if */ |
50 | /* possible. */ | |
c7de829c WD |
51 | } |
52 | ||
53 | /**************************************************************************** | |
54 | REMARKS: | |
55 | Compute the lap time since the timer was started. | |
56 | ****************************************************************************/ | |
57 | static ulong _LZTimerLap( | |
58 | LZTimerObject *tm) | |
59 | { | |
8bde7f77 WD |
60 | /* TODO: Compute the lap time between the current time and when the */ |
61 | /* timer was started. */ | |
c7de829c WD |
62 | return 0; |
63 | } | |
64 | ||
65 | /**************************************************************************** | |
66 | REMARKS: | |
67 | Stop the Zen Timer counting. | |
68 | ****************************************************************************/ | |
69 | static void _LZTimerOff( | |
70 | LZTimerObject *tm) | |
71 | { | |
8bde7f77 | 72 | /* TODO: Stop the timer counting. Should be a macro if possible. */ |
c7de829c WD |
73 | } |
74 | ||
75 | /**************************************************************************** | |
76 | REMARKS: | |
77 | Compute the elapsed time in microseconds between start and end timings. | |
78 | ****************************************************************************/ | |
79 | static ulong _LZTimerCount( | |
80 | LZTimerObject *tm) | |
81 | { | |
8bde7f77 | 82 | /* TODO: Compute the elapsed time and return it. Always microseconds. */ |
c7de829c WD |
83 | return 0; |
84 | } | |
85 | ||
86 | /**************************************************************************** | |
87 | REMARKS: | |
88 | Define the resolution of the long period timer as microseconds per timer tick. | |
89 | ****************************************************************************/ | |
90 | #define ULZTIMER_RESOLUTION 1 | |
91 | ||
92 | /**************************************************************************** | |
93 | REMARKS: | |
94 | Read the Long Period timer from the OS | |
95 | ****************************************************************************/ | |
96 | static ulong _ULZReadTime(void) | |
97 | { | |
8bde7f77 WD |
98 | /* TODO: Read the long period timer from the OS. The resolution of this */ |
99 | /* timer should be around 1/20 of a second for timing long */ | |
100 | /* periods if possible. */ | |
c7de829c WD |
101 | } |
102 | ||
103 | /**************************************************************************** | |
104 | REMARKS: | |
105 | Compute the elapsed time from the BIOS timer tick. Note that we check to see | |
106 | whether a midnight boundary has passed, and if so adjust the finish time to | |
107 | account for this. We cannot detect if more that one midnight boundary has | |
108 | passed, so if this happens we will be generating erronous results. | |
109 | ****************************************************************************/ | |
110 | ulong _ULZElapsedTime(ulong start,ulong finish) | |
111 | { return finish - start; } |