FreeRDP
measure.h File Reference
#include <freerdp/config.h>
#include <time.h>
#include <winpr/string.h>
#include <winpr/sysinfo.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 MEASURE_LOOP_START(_prefix_, _count_)
 
#define MEASURE_LOOP_STOP
 
#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 measure_delta_time (UINT64 t0, UINT64 t1)
 
void measure_floatprint (float t, char *output)
 

Macro Definition Documentation

◆ MEASURE_GET_RESULTS

#define MEASURE_GET_RESULTS (   _result_)
Value:
_delta = measure_delta_time(_start, _stop); \
(_result_) = (float)_count / _delta; \
free(_prefix); \
}
#define PROFILER_STOP
Definition: measure.h:70
float measure_delta_time(UINT64 t0, UINT64 t1)
Definition: prim_test.c:39
WINPR_API UINT64 winpr_GetTickCount64NS(void)
Definition: sysinfo.c:579

◆ MEASURE_LOOP_START

#define MEASURE_LOOP_START (   _prefix_,
  _count_ 
)
Value:
{ \
UINT64 _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'; \
_start = winpr_GetTickCount64NS(); \
PROFILER_START(_prefix); \
_loop = (_count); \
do \
{
WINPR_API char * _strdup(const char *strSource)
Definition: winpr/libwinpr/crt/string.c:218

◆ MEASURE_LOOP_STOP

#define MEASURE_LOOP_STOP
Value:
} \
while (--_loop) \
;

◆ MEASURE_SHOW_RESULTS

#define MEASURE_SHOW_RESULTS (   _result_)
Value:
_delta = measure_delta_time(_start, _stop); \
(_result_) = (float)_count / _delta; \
measure_floatprint((float)_count / _delta, _str1); \
printf("%s: %9d iterations in %5.1f seconds = %s/s \n", _prefix, _count, _delta, _str1); \
free(_prefix); \
}

◆ MEASURE_SHOW_RESULTS_SCALED

#define MEASURE_SHOW_RESULTS_SCALED (   _scale_,
  _label_ 
)
Value:
_delta = measure_delta_time(_start, _stop); \
measure_floatprint((float)_count / _delta, _str1); \
measure_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); \
}

◆ MEASURE_TIMED

#define MEASURE_TIMED (   _label_,
  _init_iter_,
  _test_time_,
  _result_,
  _call_ 
)
Value:
{ \
float _r; \
MEASURE_LOOP_START(_label_, _init_iter_); \
_call_; \
MEASURE_LOOP_STOP; \
MEASURE_GET_RESULTS(_r); \
MEASURE_LOOP_START(_label_, _r* _test_time_); \
_call_; \
MEASURE_LOOP_STOP; \
MEASURE_SHOW_RESULTS(_result_); \
}

◆ PROFILER_START

#define PROFILER_START (   _prefix_)

◆ PROFILER_STOP

#define PROFILER_STOP

Function Documentation

◆ measure_delta_time()

float measure_delta_time ( UINT64  t0,
UINT64  t1 
)
Here is the call graph for this function:

◆ measure_floatprint()

void measure_floatprint ( float  t,
char *  output 
)