program ScheduleFunction;
uses
SysUtils;
procedure MyFunction;
begin
WriteLn('Function executed after 5 seconds!');
end;
begin
WriteLn('Waiting for 5 seconds...');
Sleep(5000); // Pause for 5000 milliseconds (5 seconds)
MyFunction; // Call the function
end.
(*
run:
Waiting for 5 seconds...
Function executed after 5 seconds!
*)