Code :
with Ada.Text_Io; with Ada.Calendar; with Ada.Calendar.Formatting; with Ada.Calendar.Time_Zones; use Ada, Ada.Calendar; procedure Backtime is Begin_Of_Quantum : Time := Time_Of(2015, 05, 05, 43200.0); End_Of_Quantum : Time := Time_Of(2015, 05, 14, 43200.0); Date : Time := Clock; begin loop Text_Io.Put(Character'Val(13)); Text_Io.Put ("Date : " & Formatting.Image(Date, True, Time_Zones.Utc_Time_offset(Date))); Text_Io.Put("Elap : " ); Text_Io.Put(Duration'Image(Date - Begin_Of_Quantum)); Text_Io.Put("Remain : " ); Text_Io.Put(Duration'Image(End_Of_Quantum - Date)); Date := Clock; delay 0.1; end loop; end Backtime;
|