Post Reply 
Key pressing slows down program execution?
08-05-2018, 03:31 PM
Post: #2
RE: Key pressing slows down program execution?
(08-05-2018 02:06 PM)komame Wrote:  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?

Bonjour
Peut-être le fait qu'un programme peut être stoppé
avec la touche 'ON' et qu'il y a un test en ce sens lorsque une touche
est enclenchée.
Seulement un hypothèse.


Hello
Maybe the fact that a program can be stopped
with the key 'ON' and that there is a test in this sense when a key
is engaged.
Only a hypothesis.

Sorry for my english
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Key pressing slows down program execution? - Tyann - 08-05-2018 03:31 PM



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