summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-17 18:13:32 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-17 18:13:32 +0000
commit789d0e882e0fd5473f1058cf583b911aa079d827 (patch)
tree5b1d32bdbd1c4f71fb3b9fad120a73de6f269d5c
parent2009-09-17 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadada-examples-789d0e882e0fd5473f1058cf583b911aa079d827.tar.bz2
2009-09-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile, delay_until.adb: Make follow standard RTEMS test output format. Add output screens where appropriate. * delay_until.scn: New file.
-rw-r--r--delay_until/ChangeLog6
-rw-r--r--delay_until/Makefile2
-rw-r--r--delay_until/delay_until.adb40
-rw-r--r--delay_until/delay_until.scn8
4 files changed, 47 insertions, 9 deletions
diff --git a/delay_until/ChangeLog b/delay_until/ChangeLog
index 2c25713..73f62ef 100644
--- a/delay_until/ChangeLog
+++ b/delay_until/ChangeLog
@@ -1,5 +1,11 @@
2009-09-17 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * 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 <joel.sherrill@oarcorp.com>
+
* .cvsignore: New file.
2007-09-27 Joel Sherrill <joel.sherrill@oarcorp.com>
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.