-
Notifications
You must be signed in to change notification settings - Fork 9
/
modTiming.bas
145 lines (109 loc) · 3.86 KB
/
modTiming.bas
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
144
Attribute VB_Name = "modTiming"
Option Explicit
Public timing_decimals As Integer
Public timing_start As Long
Public timing_attackrequest As Single
Public timing_delete As Single
Public timing_getexist As Single
Public timing_getlongrequest As Single
Public timing_get_nonexistent As Single
Public timing_head As Single
Public timing_options As Single
Public timing_testmethod As Single
Public timing_protocolversion As Single
Public Function CurrentTime() As Single
CurrentTime = Timer
End Function
Public Function NormalizeTiming(ByRef sTiming As Single) As String
NormalizeTiming = sTiming & " sec"
End Function
Public Function AverageTiming() As Single
Dim sTotalTime As Single
If (timing_attackrequest > 0) Then
sTotalTime = sTotalTime + timing_attackrequest
End If
If (timing_delete > 0) Then
sTotalTime = sTotalTime + timing_delete
End If
If (timing_getexist > 0) Then
sTotalTime = sTotalTime + timing_getexist
End If
If (timing_getlongrequest > 0) Then
sTotalTime = sTotalTime + timing_getlongrequest
End If
If (timing_get_nonexistent > 0) Then
sTotalTime = sTotalTime + timing_get_nonexistent
End If
If (timing_options > 0) Then
sTotalTime = sTotalTime + timing_options
End If
If (timing_testmethod > 0) Then
sTotalTime = sTotalTime + timing_testmethod
End If
If (timing_protocolversion > 0) Then
sTotalTime = sTotalTime + timing_protocolversion
End If
If (tests_count > 0) Then
AverageTiming = (sTotalTime / tests_count)
End If
End Function
Public Function MinimumTiming() As Single
Dim sMinimumTime As Single
If (timing_attackrequest > 0) Then
sMinimumTime = timing_attackrequest
End If
If (timing_delete > 0 And timing_delete < sMinimumTime) Then
sMinimumTime = timing_delete
End If
If (timing_getexist > 0 And timing_getexist < sMinimumTime) Then
sMinimumTime = timing_getexist
End If
If (timing_getlongrequest > 0 And timing_getlongrequest < sMinimumTime) Then
sMinimumTime = timing_getlongrequest
End If
If (timing_get_nonexistent > 0 And timing_get_nonexistent < sMinimumTime) Then
sMinimumTime = timing_get_nonexistent
End If
If (timing_options > 0 And timing_options < sMinimumTime) Then
sMinimumTime = timing_options
End If
If (timing_testmethod > 0 And timing_testmethod < sMinimumTime) Then
sMinimumTime = timing_testmethod
End If
If (timing_protocolversion > 0 And timing_protocolversion < sMinimumTime) Then
sMinimumTime = timing_protocolversion
End If
If (tests_count > 0) Then
MinimumTiming = sMinimumTime
End If
End Function
Public Function MaximumTiming() As Single
Dim sMaximumTime As Single
If (timing_attackrequest > 0) Then
sMaximumTime = timing_attackrequest
End If
If (timing_delete > 0 And timing_delete > sMaximumTime) Then
sMaximumTime = timing_delete
End If
If (timing_getexist > 0 And timing_getexist > sMaximumTime) Then
sMaximumTime = timing_getexist
End If
If (timing_getlongrequest > 0 And timing_getlongrequest > sMaximumTime) Then
sMaximumTime = timing_getlongrequest
End If
If (timing_get_nonexistent > 0 And timing_get_nonexistent > sMaximumTime) Then
sMaximumTime = timing_get_nonexistent
End If
If (timing_options > 0 And timing_options > sMaximumTime) Then
sMaximumTime = timing_options
End If
If (timing_testmethod > 0 And timing_testmethod > sMaximumTime) Then
sMaximumTime = timing_testmethod
End If
If (timing_protocolversion > 0 And timing_protocolversion > sMaximumTime) Then
sMaximumTime = timing_protocolversion
End If
If (tests_count > 0) Then
MaximumTiming = sMaximumTime
End If
End Function