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

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • 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.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <rtems/btimer.h>
15
16#include <bsp.h>
17#include <rtems/timerdrv.h>
18#include "test_support.h"
19#include "timesys.h"
20#include "tmtests_empty_function.h"
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  uint32_t loop_overhead;
32  uint32_t 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.