-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathD0S.Crates_Benchmark
41 lines (31 loc) · 1.05 KB
/
D0S.Crates_Benchmark
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
; Script for benchmarking the efficiency of D0S.Idler_Crates.
; Use this for tuning the loop constant.
;
; Use Full Precision for maximum resolution in benchmarking.
:name D0S.Crates:Benchmark
isopen("tradingpost")
key.b()
:local double next_time
:local double end_time
:global int turbo.register
#trading "<size=20><color=white>trading"
#exiting "Exiting</color></size>"
#benchmark "<size=20><color=white>benchmark"
#remaining (end_time - next_time)
#seconds(x) (1e7 * {x})
show("tradingpost", false)
show("towertesting", true)
execute("D0S.Crates:Idler_v2")
next_time = now()
end_time = next_time + {seconds(15)}
loop:
waituntil(now() > next_time)
gss({benchmark}, "0:" . d2s(floor({remaining}/{seconds(10)})) .\
d2s(floor({remaining}/{seconds(1)}) % 10.) . "</color></size>")
next_time += {seconds(1)}
goto(if(gsg({trading}) == "", end, if(next_time <= end_time, loop, cleanup)))
cleanup:
gss({trading}, {exiting})
waituntil(gsg({trading}) == "")
end:
gss({benchmark}, "final: " . d2s((now() - end_time + {seconds(15)}) / {seconds(1)}) . "</color></size>")