I am working with 2 virtual machines (VMWare); One VM has GNATPro Ada compiler 7.3.2 and Ada.Real_Time.Clock returns the number of seconds since the beginning of the epoch as expected. The other VM has GNATPro 19.0 and Ada.Real_Time.Clock returns the number of seconds since the VM Started.
We are using Ada 95 on both VMs.
I have checked that the time setting on both virtual machines are the same.
To check that it was a compiler difference I compiled a small test program on Gnat Pro 19.0 and ran it on the virtual machine with the older compiler. I got the same results as I did on the VM with newer version of the compiler. I then compiled the test program with the older compiler and ran it on the VM with the newer compiler and got the same results as on the VM with the older compiler.
My question is does anyone have any idea how I can get the Ada.Real_Time.Clock to return the number of seconds from the start of the epoch for GNATPro 19.0
Below is the test program.
with Test_Io;
with Ada.Real_Time;
procedure Time_Test is
Current_Real_Time : Ada.Real_Time.Time;
Time_Span : Ada.Real_Time.Time_Span;
Seconds_Count : Ada.Real_Time.Seconds_Count;
begin
Current_Real_Time := Ada.Real_Time.Clock;
Ada.Real_Time.Split (
T => Current_Real_Time,
Sc => Seconds_Count,
Ts => Time_Span);
Test_Io.Put_Line("TRACE: Seconds_Count = " & Seconds_Count'Img);
end Time_Test;