--
-- THIS PROGRAM MEASURES THE TIME REQUIRED FOR A SIMPLE RENDEZVOUS.
--
--
-- PLEASE SET TIMES LARGE ENOUGH TO PROVIDE AT LEAST TWO SIGNIFICANT
-- DIGITS IN AVERAGE RENDEZ TIMES, I.E., THE DIFFERENCE BETWEEN
-- THE ELAPSED TIME AND THE LOOP TIME MUST BE AT LEAST 100 TIMES
-- DURATION'SMALL.

with Instrument;
use Instrument;
with System;
use System;
procedure Renda1 is

    Times : constant Positive := 1000;



    task T is
        entry Call;
    end T;

    package Prevent is
        Count : Natural := 0;
        procedure Prevent_Optimization;
    end Prevent;
    use Prevent;

    task body T is
    begin
        loop
            select
                accept Call;
            or
                terminate;
            end select;
        end loop;
    end T;

    package body Prevent is
        procedure Prevent_Optimization is
        begin
            Count := Ident_Int (Count + 1);
        end Prevent_Optimization;
    end Prevent;

begin
    Start ("RENDA1", " TIME FOR SIMPLE RENDEZVOUS (CONTROL)");


    for N in 1 .. Times loop
        Prevent_Optimization;
        --    T.CALL;
    end loop;

    Stop;

end Renda1;