source: rtems/c/src/lib/libbsp/shared/timercpucounter.c @ 8f550d2

5
Last change on this file since 8f550d2 was b8e97e5, checked in by Sebastian Huber <sebastian.huber@…>, on 03/27/17 at 11:52:35

bsps: Add simple CPU counter benchmark timer

  • Property mode set to 100644
File size: 779 bytes
Line 
1/*
2 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#include <rtems/btimer.h>
16#include <rtems/counter.h>
17
18static uint32_t benchmark_timer_base;
19
20void benchmark_timer_initialize(void)
21{
22  benchmark_timer_base = rtems_counter_read();
23}
24
25benchmark_timer_t benchmark_timer_read(void)
26{
27  return rtems_counter_difference(rtems_counter_read(), benchmark_timer_base);
28}
29
30void benchmark_timer_disable_subtracting_average_overhead(
31  bool find_average_overhead
32)
33{
34  (void) find_average_overhead;
35}
Note: See TracBrowser for help on using the repository browser.