Post Reply 
Key pressing slows down program execution?
08-05-2018, 02:06 PM (This post was last modified: 08-05-2018 02:16 PM by komame.)
Post: #1
Key pressing slows down program execution?
Hi,

I noticed that pressing the keys slows down the program execution even if there is no check if any key was pressed.

Here is a simple example of drawing a color table and taking a time measurement of this drawing.
You need real hardware to perform this test.
I tried this on newest FW 2.0.0.13865 (2018 07 06).

Code:
EXPORT PERF_TEST()
BEGIN
 local tck,x,y;
 
 RECT_P(G0,#0); //clear screen

 REPEAT
  TICKS▶tck;
  //draw color table
  FOR x FROM 1 TO 38 DO
   FOR y FROM 1 TO 27 DO
    RECT_P(x*8,y*8,x*8+6,y*8+6,RGB(x*6,y*7,(x+y)*3));
   END;
  END;
  //get the time measurnment
  TICKS-tck▶tck;
  TEXTOUT_P(tck,G0,5,230,1,#FFFFFF,100,#0); //show the time
 UNTIL 0;

END;

My Prime shows about 260ms measurement in no key is pressed and about 330ms when pressed. Pressing the key slows down the program execution by 25% in this case. That's quite a lot of time considering the fact that the program does not even have a test for pressing a key.

What is the reason?

Piotr Kowalewski
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Key pressing slows down program execution? - komame - 08-05-2018 02:06 PM



User(s) browsing this thread: 1 Guest(s)