There's is some code I'm testing in a Line Graph widget. I use this to make the widget "live" and update it's graphData every x ms. When the data contains 145 lines, it takes 112ms average, per iteration. If I raise the number of data to 300 lines (I want to be able to display longer trends) it raises to 280ms average per iteration and naturally the GUI becomes a bit slower.
So, I was wondering if the line "set the graphData of me to sGraphData" could be changed somehow so that the value is passed by reference instead of copying the value, and thus anytime sGraphData changes, the widget would update itself without me having to tell him when to do it.
the LoopPaint is every 50ms, but the uFlag updates about every 400ms.
Code: Select all
command LoopPaint
local tTime
if the uFlag of me then
set the uFlag of me to false
delete line 1 of sGraphData
put "," & the uSP of me & "," & the uPV of me & "," & the uCV of me &\
cr & ",100,50,-5" into line - 1 of sGraphData
put the milliseconds into tTime
set the graphData of me to sGraphData //Line being tested
put the milliseconds - tTime into tTime
add 1 to sCounter
add tTime to sSum
put round( sSum/sCounter ,0) into tTime
writeLog tTime
end if
send "LoopPaint" to me in 50 milliseconds
end LoopPaint
Thanks!