本帖最后由 annybaby 于 2012-11-22 15:47 编辑
标记为[已解决]吧,因为讨论的意义不是很大~~
AU本身的问题,太短的时间计算不了,实践得出的经验au的最短延时约为10毫秒
即sleep(1)~sleep(10)几乎无差别,都相当于sleep(10)
Local $t2
For $m=1 To 100
$t = TimerInit()
$arr = _findcolor(0,0,154,112, 0xF000FF)
$t2 &= TimerDiff($t)&@LF
Sleep(1000)
Next
ConsoleWrite($t2)
代码中的_findcolor()是用来搜索屏幕像素的自定义函数,本来是打算测试一下代码效率的,但测试几次后发现,有时返回的用时会是负数,于是就测试了一百次,看看返回的负值有多少个~~
其中,sleep(1000)是多余的,只是为了结果更保险些~~
得到的结果出现负值的概率还挺大的!!~~
140.24995710594
56.4743440893039
66.240585674963
76.1914190828566
57.5678994542191
57.3125487492303
-12.2697520565465
53.6694999552639
146.430615832382
65.6906533054741
71.8202070493624
135.258298553181
143.238442550907
150.947186623369
74.3685862854797
127.496207428304
63.3407214622927
54.009087751246
64.8533265264233
147.012936111535
-4.79260695883749
-9.36612000863144
135.212153492313
67.6011131403188
6.91249401325242
-6.27595090603833
130.638494655348
-4.12246859260117
66.9312795061131
73.0168365762646
-15.8480834513139
-13.0167581564502
-17.097744772451
95.9299426851155
-22.1038057293832
101.82371962548
-11.5321915969748
-19.3663121108614
71.4762124808556
75.5055351757604
141.168974700399
55.5257011731394
-12.0111982442382
55.1016457634879
136.86799734741
142.074626190113
65.0441850918143
54.7941616711315
67.434723662258
152.619036541528
140.932037915191
56.3454208617759
147.485694436404
139.607338831492
-9.06408793545365
-15.2590064367405
69.3611179823477
2.43561049036068
54.1891749077646
139.173066741051
53.777131940022
138.390229627953
131.996096377426
62.2685478650337
65.9495192181176
-16.8272806218849
141.81779392957
64.8710867723141
66.5009526165376
53.4612069283117
145.56883049215
53.733970516255
147.885496544791
148.767507881454
140.985353915464
-9.83356473318842
125.991371715183
65.5287148097662
52.7553591259085
147.07921611764
128.527932190544
137.680810302995
-21.673956726999
143.787427040626
-18.1220828092188
64.7279653479156
137.700677884033
73.5192544328247
143.268566285795
141.977121413872
127.178475076709
66.098331078983
53.353880728199
53.2318505497282
61.9456498055294
60.7462745325074
133.403577838245
53.5895517439198
60.8564396351637
63.9405540965143
|