In my program I have 15 blocks of code as follows:
if LED(X,1) & 1 = 1 then
outd R1, 1
else
outd R1, 0
endif
At the start of the code I put settick (0) and before the next X I put z = gettick. I got back 54 or 55 on subsequent runs. This would indicate that it took 5500 micro seconds or about 366 micro seconds per if. This seems exceeding slow, I was expecting less than 50 micro seconds per if.
execution speed EZSBC
Re: execution speed EZSBC
Try using the IFF statement. It is faster. Also, brackets may speed up the evaluation.
Re: execution speed EZSBC
I get a syntax error on: IIF(LED(X,1) & 1,OUTD R1,1,OUTD R1,0). Sitting reading something unrelated, I remembered something of the example in the manual. I changed everything around and the execution down to 48 ticks.