[fpc-pascal] How to find where my app consumes CPU?

Bo Berglund bo.berglund at gmail.com
Wed May 19 09:00:55 CEST 2021


On Wed, 19 May 2021 00:29:17 +0200, Bo Berglund via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

>Could this tiny loop consume 6-7% CPU cycles?

Thanks for all of the responses, I will test tomorrow.

I have noted that there are no other service processes that are waiting for some
action but show up with CPU cycles above 0 in the top display...
So there is obviously something that can be done, possibly not by free pascal
though...

Most other services are written in other languages, I assume.

Example for the two openvpn service processes I have on another RPi:

top - 01:57:13 up 91 days, 11:04,  2 users,  load average: 0.04, 0.04, 0.00
Tasks:   2 total,   0 running,   2 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.1 us,  0.0 sy,  0.0 ni, 99.9 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :   948304 total,    45656 free,   506952 used,   395696 buff/cache
KiB Swap:   102396 total,    86780 free,    15616 used.   357904 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
  458 openvpn   20   0    8588   5180   4508 S   0.0  0.5   5:47.97 openvpn
  438 openvpn   20   0    8588   5328   4568 S   0.0  0.6   5:45.86 openvpn


-- 
Bo Berglund
Developer in Sweden



More information about the fpc-pascal mailing list