librfn
An ad-hoc utility library
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
libbench.h
Go to the documentation of this file.
1
/*
2
* libbench.h
3
*
4
* Part of librfn (a general utility library from redfelineninja.org.uk)
5
*
6
* Copyright (C) 2015 Daniel Thompson <daniel@redfelineninja.org.uk>
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published
10
* by the Free Software Foundation; either version 3 of the License, or
11
* (at your option) any later version.
12
*/
13
26
#include <assert.h>
27
#include <stdio.h>
28
#include <
string.h
>
29
30
#include "
librfn.h
"
31
32
enum
{
33
BENCHMARK_SINGLE
,
34
BENCHMARK_PAIRED
,
35
BENCHMARK_SIMPLE_RUN
,
36
BENCHMARK_ATOMIC_RUN
,
37
BENCHMARK_MAX
38
};
39
40
typedef
struct
{
41
pt_t
pt
;
42
fibre_t
*
wakeup
;
43
stats_t
stats
[
BENCHMARK_MAX
];
44
}
benchmark_results_t
;
45
46
void
benchmark_init
(
benchmark_results_t
*results,
fibre_t
*wakeup);
47
int
benchmark_run_once
(
benchmark_results_t
*results);
48
const
char
*
benchmark_get_result
(
benchmark_results_t
*results,
int
n,
49
stats_t
*s);
50
void
benchmark_show_results
(
benchmark_results_t
*results);
51
void
benchmark_show_csv
(
benchmark_results_t
*results, FILE *f);
52
BENCHMARK_SIMPLE_RUN
Definition:
libbench.h:35
string.h
benchmark_results_t::pt
pt_t pt
Definition:
libbench.h:41
pt_t
uint16_t pt_t
Definition:
protothreads.h:86
benchmark_show_results
void benchmark_show_results(benchmark_results_t *results)
Definition:
libbench.c:223
BENCHMARK_PAIRED
Definition:
libbench.h:34
benchmark_results_t
Definition:
libbench.h:40
benchmark_get_result
const char * benchmark_get_result(benchmark_results_t *results, int n, stats_t *s)
Definition:
libbench.c:213
benchmark_show_csv
void benchmark_show_csv(benchmark_results_t *results, FILE *f)
Definition:
libbench.c:236
BENCHMARK_SINGLE
Definition:
libbench.h:33
benchmark_run_once
int benchmark_run_once(benchmark_results_t *results)
Definition:
libbench.c:159
stats
Definition:
stats.h:41
librfn.h
BENCHMARK_MAX
Definition:
libbench.h:37
benchmark_results_t::wakeup
fibre_t * wakeup
Definition:
libbench.h:42
fibre
Fibre descriptor.
Definition:
fibre.h:64
BENCHMARK_ATOMIC_RUN
Definition:
libbench.h:36
benchmark_init
void benchmark_init(benchmark_results_t *results, fibre_t *wakeup)
Definition:
libbench.c:151
Generated on Sat Feb 6 2016 21:25:32 for librfn by
1.8.10