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

Mattias Gaertner nc-gaertnma at netcologne.de
Wed May 19 12:02:04 CEST 2021


On Tue, 18 May 2021 18:37:38 -0400
Travis Siegel via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:

> Apparently, you can release cpu cycles, but it's with the sched_yield 
> (section 2 in the man pages), not the sleep command on linux.

What sleep command are you referring to?
What do you mean with cpu cycles?

Sleep works pretty well under Linux:

uses sysutils;
var i: integer;
begin
  for i:=1 to 10000 do sleep(1);
end.

time ./test1 

real	0m10,791s
user	0m0,021s
sys	0m0,018s

Mattias


More information about the fpc-pascal mailing list