Index: delay_until/.cvsiginore
===================================================================
--- delay_until/.cvsiginore	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
+++ delay_until/.cvsiginore	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
@@ -0,0 +1,5 @@
+b~hello.adb
+b~hello.ads
+b~hello.ali
+hello
+hello.ali
Index: delay_until/ChangeLog
===================================================================
--- delay_until/ChangeLog	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
+++ delay_until/ChangeLog	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
@@ -0,0 +1,4 @@
+2007-09-27	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* .cvsiginore, ChangeLog, Makefile, README, delay_until.adb: New files.
+
Index: delay_until/Makefile
===================================================================
--- delay_until/Makefile	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
+++ delay_until/Makefile	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
@@ -0,0 +1,25 @@
+#
+#  Makefile for Ada Delay Until Benchmark
+#
+#  See README.Makefiles in the main ada-examples directory.
+#
+
+PROGRAM=delay_until
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+# stack size for the first Ada thread
+CFLAGS +=-DGNAT_MAIN_STACKSPACE=100
+
+# initialize the network stack -- assumes existence of networkconfig.h
+# CFLAGS +=-DMAIN_USE_NETWORKING=1
+
+# Should we prompt for command line arguments?
+# DEFINES +=-DMAIN_USE_REQUIRES_COMMAND_LINE
+
+# If you want to hard-code the command line, define this to a string
+# DEFINES += -DMAIN_COMMAND_LINE="ARGS"
+
+include ../Makefile.shared
Index: delay_until/README
===================================================================
--- delay_until/README	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
+++ delay_until/README	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
@@ -0,0 +1,9 @@
+#
+#  $Id$
+#
+
+This directory contains a Ada example program with a delay until. 
+
+See the README.Makefiles in the top directory for instructions
+on building for most BSPs.
+
Index: delay_until/delay_until.adb
===================================================================
--- delay_until/delay_until.adb	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
+++ delay_until/delay_until.adb	(revision f27b2510f8789b2a5c99abe3f5007016bbe23211)
@@ -0,0 +1,41 @@
+with Ada.Real_Time;
+with Ada.Text_Io;
+
+use type Ada.Real_Time.Time;
+use type Ada.Real_Time.Time_Span;
+
+
+procedure Delay_Until_Test 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);
+
+   Iterations : constant := 1000;
+   Actual_Span : array (1..Iterations) of Ada.Real_Time.Time_Span;
+   Average_Span : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero;
+   Max_Span     : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_First;
+   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");
+   Next_Wakeup := Ada.Real_Time.Clock + Period;
+   for Count in 1..Iterations loop
+      delay until Next_Wakeup;
+
+      Actual_Span (Count) := Ada.Real_Time.Clock - (Next_Wakeup - Period);
+      Average_Span := Average_Span + (Actual_Span (Count) / Iterations);
+      if Actual_Span (Count) > Max_Span then
+         Max_Span := Actual_Span (Count);
+      end if;
+      if Actual_Span (Count) < Min_Span then
+         Min_Span := Actual_Span (Count);
+      end if;
+
+      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;
