Skip to content
Snippets Groups Projects
Commit a027a1e6 authored by Hauke Petersen's avatar Hauke Petersen
Browse files

sys/benchmark: incl irq.h and fixed output

parent 6265da28
No related branches found
No related tags found
No related merge requests found
/*
* Copyright (C) 2017 Freie Universität Berlin
* Copyright (C) 2017,2018 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
......@@ -27,6 +27,10 @@ void benchmark_print_time(uint32_t time, unsigned long runs, const char *name)
uint32_t full = (time / runs);
uint32_t div = (time - (full * runs)) / (runs / 1000);
printf("%11s: %9" PRIu32 "us --- %2" PRIu32 ".%03" PRIu32 "us per call\n",
name, time, full, div);
uint32_t per_sec = (uint32_t)(((uint64_t)1000000UL * runs) / time);
printf("%25s: %9" PRIu32 "us"
" --- %2" PRIu32 ".%03" PRIu32 "us per call"
" --- %9" PRIu32 " calls per sec\n",
name, time, full, div, per_sec);
}
/*
* Copyright (C) 2017 Freie Universität Berlin
* Copyright (C) 2017,2018 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
......@@ -23,6 +23,7 @@
#include <stdint.h>
#include "irq.h"
#include "xtimer.h"
#ifdef __cplusplus
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment