Benchmark
 All Classes Files Functions Variables Typedefs Macros
Macros | Functions
textbin.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <limits.h>
#include <float.h>
#include "benchmark.h"
#include "textbinutil.h"

Macros

#define _GNU_SOURCE
 
#define N   100
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

#define _GNU_SOURCE
#define N   100

Function Documentation

int main ( int  argc,
char *  argv[] 
)
17  {
18  timer *t = timer_alloc();
19  recorder *text_read_rec = recorder_alloc("text_read.csv");
20  recorder *text_write_rec = recorder_alloc("text_write.csv");
21  recorder *bin_read_rec = recorder_alloc("bin_read.csv");
22  recorder *bin_write_rec = recorder_alloc("bin_write.csv");
23 
24  short s = SHRT_MAX;
25  bin_short(t, bin_write_rec, bin_read_rec, s);
26  text_short(t, text_write_rec, text_read_rec, s);
27  int i = INT_MAX;
28  bin_int(t, bin_write_rec, bin_read_rec, i);
29  text_int(t, text_write_rec, text_read_rec, i);
30  long int li = LONG_MAX;
31  bin_long_int(t, bin_write_rec, bin_read_rec, li);
32  text_long_int(t, text_write_rec, text_read_rec, li);
33  long long int lli = LLONG_MAX;
34  bin_long_long_int(t, bin_write_rec, bin_read_rec, lli);
35  text_long_long_int(t, text_write_rec, text_read_rec, lli);
36 
37  float f = FLT_MAX;
38  bin_float(t, bin_write_rec, bin_read_rec, f);
39  text_float(t, text_write_rec, text_read_rec, f);
40  double d = DBL_MAX;
41  bin_double(t, bin_write_rec, bin_read_rec, d);
42  text_double(t, text_write_rec, text_read_rec, d);
43  long double ld = LDBL_MAX;
44  bin_long_double(t, bin_write_rec, bin_read_rec, ld);
45  text_long_double(t, text_write_rec, text_read_rec, ld);
46 
47  timer_free(t);
48 
49  return EXIT_SUCCESS;
50 }
void text_double(timer *t, recorder *read_rec, recorder *write_rec, double value)
Benchmark l'écriture et lecture en ascii d'un nombre de taille size
Definition: textbinutil.c:871
void bin_long_double(timer *t, recorder *read_rec, recorder *write_rec, long double value)
Benchmark l'écriture et lecture en binaire d'un nombre de taille size
Definition: textbinutil.c:952
void bin_short(timer *t, recorder *read_rec, recorder *write_rec, short value)
Benchmark l'écriture et lecture en binaire d'un nombre de taille size
Definition: textbinutil.c:40
void text_long_long_int(timer *t, recorder *read_rec, recorder *write_rec, long long int value)
Benchmark l'écriture et lecture en ascii d'un nombre de taille size
Definition: textbinutil.c:567
void timer_free(timer *t)
Retourne le temps en nanosecondes depuis le début de mesure dans t
Definition: benchmark.c:172
void text_int(timer *t, recorder *read_rec, recorder *write_rec, int value)
Benchmark l'écriture et lecture en ascii d'un nombre de taille size
Definition: textbinutil.c:263
recorder écrit les temps dans un fichier .csv
Definition: benchmark.c:208
void bin_int(timer *t, recorder *read_rec, recorder *write_rec, int value)
Benchmark l'écriture et lecture en binaire d'un nombre de taille size
Definition: textbinutil.c:192
timer permet de mesurer le temps écoulé entre deux moments
Definition: benchmark.c:43
timer * t
Definition: memfork.c:25
void bin_long_long_int(timer *t, recorder *read_rec, recorder *write_rec, long long int value)
Benchmark l'écriture et lecture en binaire d'un nombre de taille size
Definition: textbinutil.c:496
void text_long_double(timer *t, recorder *read_rec, recorder *write_rec, long double value)
Benchmark l'écriture et lecture en ascii d'un nombre de taille size
Definition: textbinutil.c:1023
void text_long_int(timer *t, recorder *read_rec, recorder *write_rec, long int value)
Benchmark l'écriture et lecture en ascii d'un nombre de taille size
Definition: textbinutil.c:415
void bin_float(timer *t, recorder *read_rec, recorder *write_rec, float value)
Benchmark l'écriture et lecture en binaire d'un nombre de taille size
Definition: textbinutil.c:648
int i
Definition: mutsem.c:43
recorder * recorder_alloc(char *filename)
Alloue un recorder
Definition: benchmark.c:219
void bin_double(timer *t, recorder *read_rec, recorder *write_rec, double value)
Benchmark l'écriture et lecture en binaire d'un nombre de taille size
Definition: textbinutil.c:800
timer * timer_alloc()
Alloue un timer
Definition: benchmark.c:63
void text_float(timer *t, recorder *read_rec, recorder *write_rec, float value)
Benchmark l'écriture et lecture en ascii d'un nombre de taille size
Definition: textbinutil.c:719
void bin_long_int(timer *t, recorder *read_rec, recorder *write_rec, long int value)
Benchmark l'écriture et lecture en binaire d'un nombre de taille size
Definition: textbinutil.c:344
void text_short(timer *t, recorder *read_rec, recorder *write_rec, short value)
Benchmark l'écriture et lecture en ascii d'un nombre de taille size
Definition: textbinutil.c:111