ex72.pp 463 B

123456789101112131415161718192021222324252627
  1. program example72;
  2. { Program to demonstrate the NanoSleep function. }
  3. uses Linux;
  4. Var
  5. Req,Rem : TimeSpec;
  6. Res : Longint;
  7. begin
  8. With Req do
  9. begin
  10. tv_sec:=10;
  11. tv_nsec:=100;
  12. end;
  13. Write('NanoSleep returned : ');
  14. Flush(Output);
  15. Res:=(NanoSleep(Req,rem);
  16. Writeln(res);
  17. If (res<>0) then
  18. With rem do
  19. begin
  20. Writeln('Remaining seconds : ',tv_sec);
  21. Writeln('Remaining nanoseconds : ',tv_nsec);
  22. end;
  23. end.