mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 13:31:40 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			376 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			376 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example59;
 | |
| 
 | |
| { Program to demonstrate the Alarm function. }
 | |
| 
 | |
| Uses linux;
 | |
| 
 | |
| 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.
 | 
