Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,14 +0,0 @@
|
|||
with Ada.Interrupts; use Ada.Interrupts;
|
||||
with Ada.Interrupts.Names; use Ada.Interrupts.Names;
|
||||
|
||||
package Sigint_Handler is
|
||||
protected Handler is
|
||||
entry Wait;
|
||||
procedure Handle;
|
||||
pragma Interrupt_Handler(Handle);
|
||||
pragma Attach_Handler(Handle, Sigint);
|
||||
private
|
||||
Call_Count : Natural := 0;
|
||||
end Handler;
|
||||
|
||||
end Sigint_Handler;
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
package body Sigint_Handler is
|
||||
|
||||
-------------
|
||||
-- Handler --
|
||||
-------------
|
||||
|
||||
protected body Handler is
|
||||
|
||||
----------
|
||||
-- Wait --
|
||||
----------
|
||||
|
||||
entry Wait when Call_Count > 0 is
|
||||
begin
|
||||
Call_Count := Call_Count - 1;
|
||||
end Wait;
|
||||
|
||||
------------
|
||||
-- Handle --
|
||||
------------
|
||||
|
||||
procedure Handle is
|
||||
begin
|
||||
Call_Count := Call_Count + 1;
|
||||
end Handle;
|
||||
|
||||
end Handler;
|
||||
|
||||
end Sigint_Handler;
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
with Ada.Calendar; use Ada.Calendar;
|
||||
with Ada.Text_Io; use Ada.Text_Io;
|
||||
with Sigint_Handler; use Sigint_Handler;
|
||||
|
||||
procedure Signals is
|
||||
task Counter is
|
||||
entry Stop;
|
||||
end Counter;
|
||||
task body Counter is
|
||||
Current_Count : Natural := 0;
|
||||
begin
|
||||
loop
|
||||
select
|
||||
accept Stop;
|
||||
exit;
|
||||
or delay 0.5;
|
||||
end select;
|
||||
Current_Count := Current_Count + 1;
|
||||
Put_Line(Natural'Image(Current_Count));
|
||||
end loop;
|
||||
end Counter;
|
||||
task Sig_Handler;
|
||||
|
||||
task body Sig_Handler is
|
||||
Start_Time : Time := Clock;
|
||||
Sig_Time : Time;
|
||||
begin
|
||||
Handler.Wait;
|
||||
Sig_Time := Clock;
|
||||
Counter.Stop;
|
||||
Put_Line("Program execution took" & Duration'Image(Sig_Time - Start_Time) & " seconds");
|
||||
end Sig_Handler;
|
||||
|
||||
begin
|
||||
null;
|
||||
|
||||
end Signals;
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
identification division.
|
||||
program-id. signals.
|
||||
data division.
|
||||
working-storage section.
|
||||
01 signal-flag pic 9 external.
|
||||
88 signalled value 1.
|
||||
01 half-seconds usage binary-long.
|
||||
01 start-time usage binary-c-long.
|
||||
01 end-time usage binary-c-long.
|
||||
01 handler usage program-pointer.
|
||||
01 SIGINT constant as 2.
|
||||
|
||||
procedure division.
|
||||
call "gettimeofday" using start-time null
|
||||
set handler to entry "handle-sigint"
|
||||
call "signal" using by value SIGINT by value handler
|
||||
|
||||
perform until exit
|
||||
if signalled then exit perform end-if
|
||||
call "CBL_OC_NANOSLEEP" using 500000000
|
||||
if signalled then exit perform end-if
|
||||
add 1 to half-seconds
|
||||
display half-seconds
|
||||
end-perform
|
||||
|
||||
call "gettimeofday" using end-time null
|
||||
subtract start-time from end-time
|
||||
display "Program ran for " end-time " seconds"
|
||||
goback.
|
||||
end program signals.
|
||||
|
||||
identification division.
|
||||
program-id. handle-sigint.
|
||||
data division.
|
||||
working-storage section.
|
||||
01 signal-flag pic 9 external.
|
||||
|
||||
linkage section.
|
||||
01 the-signal usage binary-long.
|
||||
|
||||
procedure division using by value the-signal returning omitted.
|
||||
move 1 to signal-flag
|
||||
goback.
|
||||
end program handle-sigint.
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
$Start_Time = (Get-date).second
|
||||
Write-Host "Type CTRL-C to Terminate..."
|
||||
$n = 1
|
||||
Try
|
||||
{
|
||||
While($true)
|
||||
{
|
||||
Write-Host $n
|
||||
$n ++
|
||||
Start-Sleep -m 500
|
||||
}
|
||||
}
|
||||
Finally
|
||||
{
|
||||
$End_Time = (Get-date).second
|
||||
$Time_Diff = $End_Time - $Start_Time
|
||||
Write-Host "Total time in seconds"$Time_Diff
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue