with Calendar, Text_Io;

----------------------
package Time_Library_1 is
    ----------------------

    --| Overview
    --| TimeLib contains procedures and functions for getting, putting,
    --| and calculating times, and dates. It augments the
    --| predefined library package Calendar to simplify IO and provide
    --| additional time routines common to all Ada Test and Evaluation
    --| Tool Set (ATETS) tools.

    --| Requires
    --| All procedures and functions that perform IO use the
    --| predefined library package Text_IO and require that the
    --| specified file be opened by the calling program prior to use.
    --| All times and durations must be of types declared in the
    --| predefined library package Calendar.

    --| Errors
    --| No error messages or exceptions are raised by any of the TimeLib
    --| procedures and functions. However, any Text_IO and Calendar
    --| exceptions that may be raised are allowed to pass, unhandled,
    --| back to the calling program.

    --| N/A:  Raises, Modifies

    --  Version         : 1.0
    --  Author          : Jeff England
    --  Initial Release : 05/19/85
    --  Last Modified   : 05/19/85



    type Timing_Type is (Raw, Wall_Clock);


    ----------------
    function Date_Of ( --| Convert the date to a string
                      Date : Calendar.Time    --| The date to be converted
                      ) return String;

    --| Effects
    --| Converts the date to a string in the format MM/DD/YYYY

    --| N/A:  Raises, Requires, Modifies, Errors


    ----------------------
    function Wall_Clock_Of ( --| Convert seconds to wall clock time
                            Seconds : Calendar.Day_Duration  --| The time to be converted
                            ) return String;

    --| Effects
    --| Converts the time of day or elapsed time, in seconds,
    --| to a string in the format HH:MM:SS.FF.

    --| N/A:  Raises, Requires, Modifies, Errors


    -------------------------
    procedure Put_Time_Of_Day
                 ( --| Put the time of day to the file
                  Fyle : in Text_Io.File_Type;       --| The output file
                  Seconds : in Calendar.Day_Duration --| The time to be output
                  );

    --| Effects
    --| If Timing = WALL_CLOCK then the time is put to the file in the
    --| format HH:MM:SS.FF. If Timing = RAW then the time of
    --| day is put to the file using new Fixed_IO( Day_Duration ).
    --|
    --| Requires
    --| Fyle must have been previously opened by the calling program.

    --| N/A:  Raises, Modifies, Errors


    ------------------
    procedure Put_Time ( --| Put the time to the file
                        Fyle : in Text_Io.File_Type;     --| The output file
                        Date : in Calendar.Time       --| The time to be output
                        );

    --| Effects
    --| If Timing = WALL_CLOCK then the time is put to the file in the
    --| format MM/DD/YYYY HH:MM:SS.FF. If Timing = RAW then the time of
    --| day is put to the file using new Fixed_IO( Day_Duration ).
    --|
    --| Requires
    --| Fyle must have been previously opened by the calling program.

    --| N/A:  Raises, Modifies, Errors


    --------------------
    procedure Set_Timing
                 ( --| Set the method of recording timing data

                  Timing :
                  Timing_Type  --| The type of timing data to be recorded

                  );

    --| Effects
    --| Sets th method of recording timing data to either RAW or Wall_Clock.
    --| If Timing = WALL_CLOCK then the time is put to the file in the
    --| format MM/DD/YYYY HH:MM:SS.FF. If Timing = RAW then the time of
    --| day is put to the file using new Fixed_IO( Day_Duration ).
    --| Overhead for either method may vary from system to system.

    --| N/A:  Raises, Requires, Modifies, Errors


end Time_Library_1;