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

4.115
Last change on this file since 33a105fb was 110e1f1, checked in by Joel Sherrill <joel.sherrill@…>, on 12/14/09 at 21:17:59

2009-12-14 Joel Sherrill <joel.sherrill@…>

  • samples/base_sp/sptest.adb, samples/hello/sptest.adb, samples/nsecs/sptest.adb, samples/ticker/sptest.adb, sptests/sp01/sptest.adb, sptests/sp02/sptest.adb, sptests/sp03/sptest.adb, sptests/sp04/sptest.adb, sptests/sp05/sptest.adb, sptests/sp06/sptest.adb, sptests/sp07/sptest.adb, sptests/sp08/sptest.adb, sptests/sp09/sptest.adb, sptests/sp11/sptest.adb, sptests/sp12/sptest.adb, sptests/sp13/sptest.adb, sptests/sp14/sptest.adb, sptests/sp15/sptest.adb, sptests/sp16/sptest.adb, sptests/sp17/sptest.adb, sptests/sp19/sptest.adp, sptests/sp20/sptest.adb, sptests/sp22/sptest.adb, sptests/sp23/sptest.adb, sptests/sp24/sptest.adb, sptests/sp25/sptest.adb, sptests/spname01/spname01.adb, sptests/spname01/sptest.adb, sptests/spname01/sptest.ads, support/address_io.adb, support/init.c, support/test_support.adb, support/test_support.ads, support/time_test_support.adb, support/timer_driver.adb, tmtests/tm01/tmtest.adb, tmtests/tm01/tmtest.ads, tmtests/tm02/tmtest.adb, tmtests/tm02/tmtest.ads, tmtests/tm03/tmtest.adb, tmtests/tm03/tmtest.ads, tmtests/tm04/tmtest.adb, tmtests/tm04/tmtest.ads, tmtests/tm05/tmtest.adb, tmtests/tm05/tmtest.ads, tmtests/tm06/tmtest.adb, tmtests/tm06/tmtest.ads, tmtests/tm07/tmtest.adb, tmtests/tm07/tmtest.ads, tmtests/tm08/tmtest.adb, tmtests/tm08/tmtest.ads, tmtests/tm09/tmtest.adb, tmtests/tm09/tmtest.ads, tmtests/tm10/tmtest.adb, tmtests/tm10/tmtest.ads, tmtests/tm11/tmtest.adb, tmtests/tm11/tmtest.ads, tmtests/tm12/tmtest.adb, tmtests/tm12/tmtest.ads, tmtests/tm13/tmtest.adb, tmtests/tm13/tmtest.ads, tmtests/tm14/tmtest.adb, tmtests/tm14/tmtest.ads, tmtests/tm15/tmtest.adb, tmtests/tm15/tmtest.ads, tmtests/tm16/tmtest.adb, tmtests/tm16/tmtest.ads, tmtests/tm17/tmtest.adb, tmtests/tm17/tmtest.ads, tmtests/tm18/tmtest.adb, tmtests/tm18/tmtest.ads, tmtests/tm19/tmtest.adb, tmtests/tm19/tmtest.ads, tmtests/tm20/tmtest.adb, tmtests/tm20/tmtest.ads, tmtests/tm21/tmtest.adb, tmtests/tm21/tmtest.ads, tmtests/tm22/tmtest.adb, tmtests/tm22/tmtest.ads, tmtests/tm23/tmtest.adb, tmtests/tm23/tmtest.ads, tmtests/tm24/tmtest.adb, tmtests/tm24/tmtest.ads, tmtests/tm25/tmtest.adb, tmtests/tm25/tmtest.ads, tmtests/tm28/tmtest.adb, tmtests/tm28/tmtest.ads, tmtests/tm29/tmtest.adb, tmtests/tm29/tmtest.ads, tmtests/tmck/tmtest.adb, tmtests/tmck/tmtest.ads, tmtests/tmoverhd/dummy_rtems.adb, tmtests/tmoverhd/tmtest.adb, tmtests/tmoverhd/tmtest.ads: Remove many warnings.
  • Property mode set to 100644
File size: 1.7 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-2009.
14--  On-Line Applications Research Corporation (OAR).
15--
16--  The license and distribution terms for this file may in
17--  the file LICENSE in this distribution or at
18--  http://www.rtems.com/license/LICENSE.
19--
20--  $Id$
21--
22
23with INTERFACES; use INTERFACES;
24with TEXT_IO;
25with UNSIGNED32_IO;
26
27package body TIME_TEST_SUPPORT is
28
29--PAGE
30--
31--  PUT_TIME
32--
33
34   procedure PUT_TIME (
35      MESSAGE          : in     STRING;
36      TOTAL_TIME       : in     RTEMS.UNSIGNED32;
37      ITERATIONS       : in     RTEMS.UNSIGNED32;
38      LOOP_OVERHEAD    : in     RTEMS.UNSIGNED32;
39      CALLING_OVERHEAD : in     RTEMS.UNSIGNED32
40   ) is
41      PER_ITERATION : RTEMS.UNSIGNED32;
42   begin
43
44      PER_ITERATION := (TOTAL_TIME - LOOP_OVERHEAD) / ITERATIONS;
45      PER_ITERATION := PER_ITERATION - CALLING_OVERHEAD;
46
47      if PER_ITERATION = 0 then
48
49         TEXT_IO.PUT( "TOTAL_TIME " );
50         UNSIGNED32_IO.PUT( TOTAL_TIME );
51         TEXT_IO.NEW_LINE;
52
53         TEXT_IO.PUT( "ITERATIONS " );
54         UNSIGNED32_IO.PUT( ITERATIONS );
55         TEXT_IO.NEW_LINE;
56
57         TEXT_IO.PUT( "LOOP_OVERHEAD " );
58         UNSIGNED32_IO.PUT( LOOP_OVERHEAD );
59         TEXT_IO.NEW_LINE;
60
61         TEXT_IO.PUT( "CALLING_OVERHEAD " );
62         UNSIGNED32_IO.PUT( CALLING_OVERHEAD );
63         TEXT_IO.NEW_LINE;
64
65      end if;
66
67      TEXT_IO.PUT( MESSAGE );
68      TEXT_IO.PUT( " " );
69      UNSIGNED32_IO.PUT( PER_ITERATION );
70      TEXT_IO.NEW_LINE;
71      TEXT_IO.FLUSH;
72
73   end PUT_TIME;
74
75end TIME_TEST_SUPPORT;
Note: See TracBrowser for help on using the repository browser.