Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with Ada.Text_IO; use Ada.Text_IO;
- with Ada.Calendar; use Ada.Calendar;
- with Ada.Calendar.Formatting; use Ada.Calendar.Formatting;
- with Ada.Calendar.Time_Zones; use Ada.Calendar.Time_Zones;
- procedure Main is
- task server is
- entry checkTime;
- end server;
- task body server is
- Now : Time;
- begin
- loop
- select
- accept checkTime do
- Now := Clock;
- put("La fecha actual es: ");
- Put_line(Image(Date => Now, Time_Zone => -3*60));
- end checkTime;
- end select;
- end loop;
- end server;
- task client;
- task body client is
- begin
- for I in Integer range 1 .. 10 loop
- server.checkTime;
- end loop;
- end client;
- begin
- null;
- end Main;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement