Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macro execution time
#8
Macro Macro274
Code:
Copy      Help
int n tOSD=timeGetTime; long tSum
rep
,long t1=perf
,sub.Func
,long t2=perf
,
,n+1; tSum+(t2-t1)
,int tNow=timeGetTime
,if tNow-tOSD>=100 ;;update OSD every 100 ms
,,OnScreenDisplay F"{tSum/n}" -1 0 0 "" 0 0 4|8 "time" ;;show average sub.Func time during the last 100 ms
,,tSum=0; n=0; tOSD=tNow
,
,0.001


#sub Func

;this function consumes CPU 100 to 1000 microseconds

long t0(perf) time=RandomInt(100 1000)
rep
,if(perf-t0>=time) break


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)