mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-28 03:53:45 +02:00
27 lines
471 B
ObjectPascal
27 lines
471 B
ObjectPascal
program example72;
|
|
|
|
{ Program to demonstrate the NanoSleep function. }
|
|
|
|
uses BaseUnix;
|
|
|
|
Var
|
|
Req,Rem : TimeSpec;
|
|
Res : Longint;
|
|
|
|
begin
|
|
With Req do
|
|
begin
|
|
tv_sec:=10;
|
|
tv_nsec:=100;
|
|
end;
|
|
Write('NanoSleep returned : ');
|
|
Flush(Output);
|
|
Res:=(fpNanoSleep(@Req,@rem));
|
|
Writeln(res);
|
|
If (res<>0) then
|
|
With rem do
|
|
begin
|
|
Writeln('Remaining seconds : ',tv_sec);
|
|
Writeln('Remaining nanoseconds : ',tv_nsec);
|
|
end;
|
|
end. |