Question about displaying strings
|
10-23-2019, 01:07 AM
Post: #13
|
|||
|
|||
RE: Question about displaying strings
I decided to explore this issue a little more, and wrote a small program testing time of the timing of center string workaround. This is a quick and dirty test routine, no fanciness involved.
(This is the first time I am trying to post the code, so, if I mess something up, my apologies.) PHP Code: EXPORT CENTER_TEST() The results slightly varied from run to run. (Is it true that HPP OS is RTOS based? That would explain it. Or is it just an effect of executing ISRs of interrupts coming to CPU during program execution?) Regardless, my typical results were as follows: 1. For the program with printing statements disabled, allocating GROB1 full screen only was 9656 ms, while allocating GROB1 one px. was 105 ms (each 10,000 times). 2. For the program with printing statements enabled, allocating GROB1 full screen and printing the string was 13096 ms, while allocating GROB1 one px. and printing the string was 1594 ms (each 10,000 times). Thus, if you subtract those numbers (respectively), you should get time that takes to print the string in GROB1 10,000 times. If you do it, you will see that the time of printing the screen depends on the size of the GROB. Note: Initially I tried to allocate the GROB of (0,0). When I did it, I was occasionally getting wrong X coordinates. I did not explore it further, but there is apparently a not handled situation in the code when the area of the GROB is zero. My conclusions: 1. The smaller the GROB, the shorter its allocation time. I am assuming this is because of GROB initialization during allocation (rather obvious conclusion...). 2. A process of printing to the undefined section of the GROB is faster than a process of printing to the defined section of the GROB. Darius |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)