From 789d0e882e0fd5473f1058cf583b911aa079d827 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 17 Sep 2009 18:13:32 +0000 Subject: 2009-09-17 Joel Sherrill * Makefile, delay_until.adb: Make follow standard RTEMS test output format. Add output screens where appropriate. * delay_until.scn: New file. --- delay_until/ChangeLog | 6 ++++++ delay_until/Makefile | 2 ++ delay_until/delay_until.adb | 40 +++++++++++++++++++++++++++++++--------- delay_until/delay_until.scn | 8 ++++++++ 4 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 delay_until/delay_until.scn diff --git a/delay_until/ChangeLog b/delay_until/ChangeLog index 2c25713..73f62ef 100644 --- a/delay_until/ChangeLog +++ b/delay_until/ChangeLog @@ -1,3 +1,9 @@ +2009-09-17 Joel Sherrill + + * Makefile, delay_until.adb: Make follow standard RTEMS test output + format. Add output screens where appropriate. + * delay_until.scn: New file. + 2009-09-17 Joel Sherrill * .cvsignore: New file. diff --git a/delay_until/Makefile b/delay_until/Makefile index 4e62c18..8dc457d 100644 --- a/delay_until/Makefile +++ b/delay_until/Makefile @@ -3,6 +3,8 @@ # # See README.Makefiles in the main ada-examples directory. # +# $Id$ +# PROGRAM=delay_until diff --git a/delay_until/delay_until.adb b/delay_until/delay_until.adb index 8253c52..193cd4b 100644 --- a/delay_until/delay_until.adb +++ b/delay_until/delay_until.adb @@ -1,3 +1,7 @@ +-- +-- $Id$ +-- + with Ada.Real_Time; with Ada.Text_Io; @@ -5,10 +9,11 @@ use type Ada.Real_Time.Time; use type Ada.Real_Time.Time_Span; -procedure Delay_Until_Test is +procedure Delay_Until is Next_Wakeup : Ada.Real_Time.Time; - Period : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Nanoseconds (16666667); --- Period : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Nanoseconds (20000); + Period : constant Ada.Real_Time.Time_Span := + Ada.Real_Time.Nanoseconds (16666667); + -- Ada.Real_Time.Nanoseconds (20000); Iterations : constant := 1000; Actual_Span : array (1..Iterations) of Ada.Real_Time.Time_Span; @@ -17,8 +22,12 @@ procedure Delay_Until_Test is Min_Span : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Last; begin - Ada.Text_Io.Put_Line (Integer'Image (Iterations) & " iterations with " & - Duration'Image (Ada.Real_Time.To_Duration(Period)) & "s period"); + Ada.Text_Io.Put_Line ("*** Delay Until Variation Test ***"); + Ada.Text_Io.Put_Line ( + Integer'Image (Iterations) & " iterations with " & + Duration'Image (Ada.Real_Time.To_Duration(Period)) & + "s period" + ); Next_Wakeup := Ada.Real_Time.Clock + Period; for Count in 1..Iterations loop delay until Next_Wakeup; @@ -35,7 +44,20 @@ begin Next_Wakeup := Next_Wakeup + Period; end loop; - Ada.Text_Io.Put_Line ("Average delay is" & Duration'Image (Ada.Real_Time.To_Duration (Average_Span)) & "s"); - Ada.Text_Io.Put_Line ("Maximum delay is" & Duration'Image (Ada.Real_Time.To_Duration (Max_Span)) & "s"); - Ada.Text_Io.Put_Line ("Minimum delay is" & Duration'Image (Ada.Real_Time.To_Duration (Min_Span)) & "s"); -end Delay_Until_Test; + Ada.Text_Io.Put_Line ( + "Average delay is" & + Duration'Image (Ada.Real_Time.To_Duration (Average_Span)) & + "s" + ); + Ada.Text_Io.Put_Line ( + "Maximum delay is" & + Duration'Image (Ada.Real_Time.To_Duration (Max_Span)) & + "s" + ); + Ada.Text_Io.Put_Line ( + "Minimum delay is" & + Duration'Image (Ada.Real_Time.To_Duration (Min_Span)) & + "s" + ); + Ada.Text_Io.Put_Line ("*** END OF Delay Until Variation Test ***"); +end Delay_Until; diff --git a/delay_until/delay_until.scn b/delay_until/delay_until.scn new file mode 100644 index 0000000..ed45436 --- /dev/null +++ b/delay_until/delay_until.scn @@ -0,0 +1,8 @@ +*** Delay Until Variation Test *** + 1000 iterations with 0.016666667s period +Average delay is 0.017096333s +Maximum delay is 0.017430333s +Minimum delay is 0.016763334s +*** END OF Delay Until Variation Test *** + +NOTE: Variation in delay depends on BSP. -- cgit v1.2.3