with Log;
with Profile;
with Calendar;
with Report_Times;
with System_Utilities;
--
--
-- ********** ADD ANY "WITH'S" YOU NEED HERE
--
--
procedure Execution_Benchmark (Response : in String := "<PROFILE>") is
    --
    Old_Response_Profile : Profile.Response_Profile := Profile.Get;
    New_Response_Profile : Profile.Response_Profile := Profile.Value (Response);
    --
    Starting_Wall_Clock_Time : Calendar.Time;  
    Ending_Wall_Clock_Time : Calendar.Time;  
    Starting_Cpu_Time : Duration;  
    Ending_Cpu_Time : Duration;
    --
begin
    --
    Profile.Set (New_Response_Profile);
    Log.Put_Line ("[Execution_Benchmark (Response => """ &
                  Profile.Image (New_Response_Profile) & """);]",
                  Profile.Auxiliary_Msg);
    --
    Log.Put_Line ("Timing execution");
    Starting_Wall_Clock_Time := Calendar.Clock;  
    Starting_Cpu_Time := System_Utilities.Cpu;
    --
    --
    -- ********** PUT THE CODE YOU WANT TO TIME EXECUTION OF HERE
    --
    --
    Ending_Cpu_Time := System_Utilities.Cpu;  
    Ending_Wall_Clock_Time := Calendar.Clock;
    Log.Put_Line ("Execution timed", Profile.Positive_Msg);
    --
    Report_Times ("EXECUTION TIME:", Starting_Wall_Clock_Time,  
                  Ending_Wall_Clock_Time,  
                  Starting_Cpu_Time,  
                  Ending_Cpu_Time);
    --
    Log.Put_Line ("[end of Execution_Benchmark command - no error(s) detected]",
                  Profile.Auxiliary_Msg);
    Profile.Set (Old_Response_Profile);
    --
exception
    when others =>
        Log.Put_Line
           ("[end of Execution_Benchmark command - error(s) detected]",
            Profile.Auxiliary_Msg);
        Profile.Set (Old_Response_Profile);
        --
end Execution_Benchmark;