source: rtems/testsuites/support/src/tmtests_support.c @ d04a7e93

4.11
Last change on this file since d04a7e93 was d04a7e93, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 25, 2010 at 4:59:06 PM

2010-06-25 Joel Sherrill <joel.sherrilL@…>

  • support/src/tmtests_support.c: Fix warning.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2010.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#include <bsp.h>
13#include <rtems/timerdrv.h>
14#include "test_support.h"
15#include "timesys.h"
16
17extern void benchmark_timer_empty_operation(
18  int    iteration,
19  void  *argument
20);
21
22void rtems_time_test_measure_operation(
23  const char               *description,
24  rtems_time_test_method_t  operation,
25  void                     *argument,
26  int                       iterations,
27  int                       overhead
28)
29{
30  int  i;
31  long loop_overhead;
32  int  end_time;
33
34  benchmark_timer_initialize();
35    for (i=0 ; i<iterations ; i++ ) {
36      benchmark_timer_empty_operation( i, argument );
37    }
38  loop_overhead = benchmark_timer_read();
39
40  benchmark_timer_initialize();
41    for (i=0 ; i<iterations ; i++ ) {
42      (*operation)( i, argument );
43    }
44  end_time = benchmark_timer_read();
45
46  put_time(
47    description,
48    end_time,
49    iterations,
50    loop_overhead,
51    overhead
52  );
53}
Note: See TracBrowser for help on using the repository browser.