forked from project-jedi/jcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCounter.dtx
127 lines (127 loc) · 4.97 KB
/
Counter.dtx
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
@@TJclCounter
<GROUP DateandTime.TimersandCounters.TJclCounter>
Summary:
Implements a high performance counter.
Description:
TJclCounter is a class wrapper around the high performance counter API functions,
QueryPerformanceCounter and QueryPerformanceFrequency. Using this class you can
easily time the execution of code or other events. The high performance counter
has a very high frequency thereby allowing for the timing of very short intervals.
The hardware must support a high performance counter or the construction of a
TJclCounter object will raise an exception.
See also:
StartCount
StopCount
Donator:
Theo Bebekis
--------------------------------------------------------------------------------
@@TJclCounter.Create
Summary:
Creates an instance of a TJclCounter class.
Description:
Creates an instance of a TJclCounter class. If the hardware does not support
high performance counters the constructor raises an exception.
Parameters:
Compensate - If compensate is True the class internally determines the overhead
associated with calling the user calling the Start and Stop methods and
corrects the resulting time; thereby providing a more accurate timing.
By default, for backwards compatibility, no compensation takes place.
See also:
StartCount
StopCount
Donator:
Theo Bebekis
--------------------------------------------------------------------------------
@@TJclCounter.Start
Summary:
Starts the timer.
Description:
Start starts the timer, resets the elapsed time and sets the Counting property to
True. To stop the timer and retrieve the elapsed time since Start was called, use
the Stop method.
See also:
StartCount
Donator:
Theo Bebekis
--------------------------------------------------------------------------------
@@TJclCounter.Stop
Summary:
Stops the timer.
Description:
The Stop method stops the timer, sets the Counting property to False and returns
the elapsed time since the Start method was called.
Result:
The elapsed time between Start and Stop calls. Unit is seconds.
See also:
StartCount
Donator:
Theo Bebekis
--------------------------------------------------------------------------------
@@TJclCounter.ElapsedTime
Summary:
Returns the elapsed time.
Description:
ElpasedTime returns the elapsed time between the last Start and Stop calls. The
value is divided by the counter's frequency before returning so the unit is seconds.
During a counting operation, Counting equals True, ElapsedTimer is always 0.
Donator:
Theo Bebekis
--------------------------------------------------------------------------------
@@TJclCounter.Overhead
Summary:
Returns the overhead time.
Description:
Overhead returns the time it takes between issueing a Start/Stop and the
actual execution. The value is the number of ticks, not the number of seconds.
Donator:
Theo Bebekis
--------------------------------------------------------------------------------
@@TJclCounter.Counting
Summary:
Returns the status of the counter.
Description:
Counting returns whether or not the counter is currently active. That is, if
Start has, but Stop hasn't, been called the return value is True. Immediately
after construction or after a call to Stop, Counting is False. When Counting is
True the ElapsedTime property is invalid.
Donator:
Theo Bebekis
--------------------------------------------------------------------------------
@@StartCount
<GROUP DateandTime.TimersandCounters>
Summary:
Starts a high performance resolution counter.
Description:
StartCount starts a high performance resolution counter. It returns a reference
to a newly created TJclCounter object. You'll need to hang on to this object to
later stop the counter and retrieve the elapsed time. StartCount is the equivalent
of instantiating a TJclCouter and immediately calling it's Start method.
Parameters:
Counter - Counter object instantiated by this function.
Compensate - If compensate is True the class internally determines the overhead
associated with calling the user calling the Start and Stop methods and
corrects the resulting time; thereby providing a more accurate timing.
By default, for backwards compatibility, no compensation takes place.
Notes:
If the hardware does not support high performance resolution counters an exception is raised.
See also:
StopCount
Donator:
Theo Bebekis
--------------------------------------------------------------------------------
@@StopCount
<GROUP DateandTime.TimersandCounters>
Summary:
Stops a high performance resolution counter.
Description:
StopCount stops a high performance resolution counter identified by the Counter
parameter. Although you can use this function with a counter you manually
instantiated, it's intended to be used in conjunction with StartCount.
Parameters:
Counter - An instance of a TJclCounter object, usually the one returned by StartCount. This object is freed before the function returns.
Result:
The elapsed time since the counter was started, in seconds.
See also:
StartCount
Donator:
Theo Bebekis