source: rtems/c/src/ada-tests/support/time_test_support.adb @ d0d73ec

4.104.114.84.95
Last change on this file since d0d73ec was 5d0f4a56, checked in by Joel Sherrill <joel.sherrill@…>, on 06/03/97 at 22:49:47

new files

  • Property mode set to 100644
File size: 1.8 KB
Line 
1--
2--  TIME_TEST_SUPPORT / SPECIFICATION
3--
4--  DESCRIPTION:
5--
6--  This package provides routines which aid the individual tests in
7--  the Timing Test Suite and simplify their design and operation.
8--
9--  DEPENDENCIES:
10--
11-- 
12--
13--  COPYRIGHT (c) 1989-1997.
14--  On-Line Applications Research Corporation (OAR).
15--  Copyright assigned to U.S. Government, 1994.
16--
17--  The license and distribution terms for this file may in
18--  the file LICENSE in this distribution or at
19--  http://www.OARcorp.com/rtems/license.html.
20--
21--  $Id$
22--
23
24with INTERFACES; use INTERFACES;
25with RTEMS;
26with TEXT_IO;
27with UNSIGNED32_IO;
28
29package body TIME_TEST_SUPPORT is
30
31--PAGE
32--
33--  PUT_TIME
34--
35
36   procedure PUT_TIME (
37      MESSAGE          : in     STRING;
38      TOTAL_TIME       : in     RTEMS.UNSIGNED32;
39      ITERATIONS       : in     RTEMS.UNSIGNED32;
40      LOOP_OVERHEAD    : in     RTEMS.UNSIGNED32;
41      CALLING_OVERHEAD : in     RTEMS.UNSIGNED32
42   ) is
43      PER_ITERATION : RTEMS.UNSIGNED32;
44   begin
45
46      PER_ITERATION := (TOTAL_TIME - LOOP_OVERHEAD) / ITERATIONS;
47      PER_ITERATION := PER_ITERATION - CALLING_OVERHEAD;
48
49      if PER_ITERATION = 0 then
50
51         TEXT_IO.PUT( "TOTAL_TIME " );
52         UNSIGNED32_IO.PUT( TOTAL_TIME );
53         TEXT_IO.NEW_LINE;
54
55         TEXT_IO.PUT( "ITERATIONS " );
56         UNSIGNED32_IO.PUT( ITERATIONS );
57         TEXT_IO.NEW_LINE;
58
59         TEXT_IO.PUT( "LOOP_OVERHEAD " );
60         UNSIGNED32_IO.PUT( LOOP_OVERHEAD );
61         TEXT_IO.NEW_LINE;
62
63         TEXT_IO.PUT( "CALLING_OVERHEAD " );
64         UNSIGNED32_IO.PUT( CALLING_OVERHEAD );
65         TEXT_IO.NEW_LINE;
66
67      end if;
68
69      TEXT_IO.PUT( MESSAGE );
70      TEXT_IO.PUT( " " );
71      UNSIGNED32_IO.PUT( PER_ITERATION );
72      TEXT_IO.NEW_LINE;
73      TEXT_IO.FLUSH;
74
75   end PUT_TIME;
76
77end TIME_TEST_SUPPORT;
Note: See TracBrowser for help on using the repository browser.