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

Henry Vermaak henry.vermaak at gmail.com
Wed May 19 15:53:04 CEST 2021


On Wed, 19 May 2021 at 14:36, Travis Siegel via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:
>
> No doubt your sleep code works just fine.
>
> I'm not saying the sleep command doesn't work.
>
> I'm saying the sleep command doesn't release unused cpu cycles for other
> threads/programs to use.

No, fpc uses nanosleep() inside sysutils.sleep() which is documented
to suspend execution (i.e. no busy waiting) so the kernel will switch
to another thread/process.

Henry


More information about the fpc-pascal mailing list