source: rtems/testsuites/support/src/tmtests_support.c @ 436ef33

4.115
Last change on this file since 436ef33 was 436ef33, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/11/11 at 06:49:22

2011-12-11 Ralf Corsépius <ralf.corsepius@…>

  • support/include/tmtests_empty_function.h: New.
  • support/src/tmtests_empty_function.c, support/src/tmtests_support.c: Include "tmtests_empty_function.h". Remove local decls (Missing prototypes).
  • Property mode set to 100644
File size: 1.2 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#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/btimer.h>
17
18#include <bsp.h>
19#include <rtems/timerdrv.h>
20#include "test_support.h"
21#include "timesys.h"
22#include "tmtests_empty_function.h"
23
24void rtems_time_test_measure_operation(
25  const char               *description,
26  rtems_time_test_method_t  operation,
27  void                     *argument,
28  int                       iterations,
29  int                       overhead
30)
31{
32  int  i;
33  uint32_t loop_overhead;
34  uint32_t end_time;
35
36  benchmark_timer_initialize();
37    for (i=0 ; i<iterations ; i++ ) {
38      benchmark_timer_empty_operation( i, argument );
39    }
40  loop_overhead = benchmark_timer_read();
41
42  benchmark_timer_initialize();
43    for (i=0 ; i<iterations ; i++ ) {
44      (*operation)( i, argument );
45    }
46  end_time = benchmark_timer_read();
47
48  put_time(
49    description,
50    end_time,
51    iterations,
52    loop_overhead,
53    overhead
54  );
55}
Note: See TracBrowser for help on using the repository browser.