execution speed EZSBC

execution speed EZSBC

Postby scrub » Sun Apr 17, 2016 5:07 am

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.
scrub
 
Posts: 3
Joined: Sat Nov 28, 2015 1:14 pm

Re: execution speed EZSBC

Postby Daniel » Sun Apr 17, 2016 5:07 pm

Try using the IFF statement. It is faster. Also, brackets may speed up the evaluation.
Daniel
 
Posts: 91
Joined: Tue Nov 13, 2012 2:10 pm

Re: execution speed EZSBC

Postby scrub » Mon Apr 18, 2016 5:24 am

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.
scrub
 
Posts: 3
Joined: Sat Nov 28, 2015 1:14 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron