FreeRDP
measure.h File Reference
#include <time.h>
#include <sys/param.h>
#include <winpr/crt.h>
This graph shows which files directly or indirectly include this file:

Macros

#define PROFILER_START(_prefix_)
 
#define PROFILER_STOP
 
#define CLOCK_MONOTONIC_RAW   4
 
#define MEASURE_LOOP_START(_prefix_, _count_)
 
#define MEASURE_LOOP_STOP   } while (--_loop);
 
#define MEASURE_GET_RESULTS(_result_)
 
#define MEASURE_SHOW_RESULTS(_result_)
 
#define MEASURE_SHOW_RESULTS_SCALED(_scale_, _label_)
 
#define MEASURE_TIMED(_label_, _init_iter_, _test_time_, _result_, _call_)
 

Functions

float _delta_time (const struct timespec *t0, const struct timespec *t1)
 
void _floatprint (float t, char *output)
 

Macro Definition Documentation

#define CLOCK_MONOTONIC_RAW   4
#define MEASURE_GET_RESULTS (   _result_)
Value:
clock_gettime(CLOCK_MONOTONIC_RAW, &_stop); \
_delta = _delta_time(&_start, &_stop); \
(_result_) = (float) _count / _delta; \
free(_prefix); \
}
#define CLOCK_MONOTONIC_RAW
Definition: measure.h:75
#define PROFILER_STOP
Definition: measure.h:68
float _delta_time(const struct timespec *t0, const struct timespec *t1)
Definition: prim_test.c:50
#define MEASURE_LOOP_START (   _prefix_,
  _count_ 
)
Value:
{ struct timespec _start, _stop; \
char *_prefix; \
int _count = (_count_); \
int _loop; \
float _delta; \
char _str1[32], _str2[32]; \
_prefix = strdup(_prefix_); \
_str1[0] = '\0'; _str2[0] = '\0'; \
clock_gettime(CLOCK_MONOTONIC_RAW, &_start); \
PROFILER_START(_prefix); \
_loop = (_count); \
do {
#define CLOCK_MONOTONIC_RAW
Definition: measure.h:75
#define PROFILER_START(_prefix_)
Definition: measure.h:67
#define MEASURE_LOOP_STOP   } while (--_loop);
#define MEASURE_SHOW_RESULTS (   _result_)
Value:
clock_gettime(CLOCK_MONOTONIC_RAW, &_stop); \
_delta = _delta_time(&_start, &_stop); \
(_result_) = (float) _count / _delta; \
_floatprint((float) _count / _delta, _str1); \
printf("%s: %9d iterations in %5.1f seconds = %s/s \n", \
_prefix, _count, _delta, _str1); \
free(_prefix); \
}
#define CLOCK_MONOTONIC_RAW
Definition: measure.h:75
void _floatprint(float t, char *output)
Definition: prim_test.c:68
#define PROFILER_STOP
Definition: measure.h:68
float _delta_time(const struct timespec *t0, const struct timespec *t1)
Definition: prim_test.c:50
#define MEASURE_SHOW_RESULTS_SCALED (   _scale_,
  _label_ 
)
Value:
clock_gettime(CLOCK_MONOTONIC_RAW, &_stop); \
_delta = _delta_time(&_start, &_stop); \
_floatprint((float) _count / _delta, _str1); \
_floatprint((float) _count / _delta * (_scale_), _str2); \
printf("%s: %9d iterations in %5.1f seconds = %s/s = %s%s \n", \
_prefix, _count, _delta, _str1, _str2, _label_); \
free(_prefix); \
}
#define CLOCK_MONOTONIC_RAW
Definition: measure.h:75
void _floatprint(float t, char *output)
Definition: prim_test.c:68
#define PROFILER_STOP
Definition: measure.h:68
float _delta_time(const struct timespec *t0, const struct timespec *t1)
Definition: prim_test.c:50
#define MEASURE_TIMED (   _label_,
  _init_iter_,
  _test_time_,
  _result_,
  _call_ 
)
Value:
{ float _r; \
MEASURE_LOOP_START(_label_, _init_iter_); \
_call_; \
MEASURE_LOOP_START(_label_, _r * _test_time_); \
_call_; \
}
#define MEASURE_GET_RESULTS(_result_)
Definition: measure.h:95
#define MEASURE_SHOW_RESULTS(_result_)
Definition: measure.h:103
#define MEASURE_LOOP_START(_prefix_, _count_)
Definition: measure.h:78
#define MEASURE_LOOP_STOP
Definition: measure.h:92
#define PROFILER_START (   _prefix_)
#define PROFILER_STOP

Function Documentation

float _delta_time ( const struct timespec *  t0,
const struct timespec *  t1 
)
void _floatprint ( float  t,
char *  output 
)