[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Schedule an alarm signal to be delivered
Source position: oldlinux.pp line 1487
function Alarm( |
Sec: LongInt |
):LongInt; |
Alarm schedules an alarm signal to be delivered to your process in Sec seconds. When Sec seconds have elapsed, Linux will send a SIGALRM signal to the current process. If Sec is zero, then no new alarm will be set. Whatever the value of Sec, any previous alarm is cancelled.
The function returns the number of seconds till the previously scheduled alarm was due to be delivered, or zero if there was none.
|
Install signal handler |
Program Example59; { Program to demonstrate the Alarm function. } Uses oldlinux; Procedure AlarmHandler(Sig : longint);cdecl; begin Writeln ('Got to alarm handler'); end; begin Writeln('Setting alarm handler'); Signal(SIGALRM,@AlarmHandler); Writeln ('Scheduling Alarm in 10 seconds'); Alarm(10); Writeln ('Pausing'); Pause; Writeln ('Pause returned'); end.
lazarus-ccr.sourceforge.net |