ll_libload kernel, "kernel32.dll"
ll_getproc GetTickCount, "GetTickCount", kernel
#module
#deffunc getoptime val
mref time, 16
ll_callfnv GetTickCount@
ll_ret time
return
#deffunc timewatch val
mref time2, 16
i = time
getoptime time2
time2 -= i
return
#global
num = 10
dim t, num
repeat num
getoptime t.cnt
repeat 1000000 : tmp++ : loop // インクリメントを100万回計測
timewatch t.cnt
mes "" + cnt + ". " + t.cnt + "ms"
loop
mes "--------"
repeat num
if cnt : tmp += t.cnt : else : tmp = t.cnt
loop
tmp = tmp / num, tmp * 100 / num \ 100
mes "平均" + tmp + "." + tmp.1 + "ms"
stop
|