tor_multipath_voip/src/stopwatch.h

30 lines
677 B
C
Raw Normal View History

2020-02-25 16:35:52 +00:00
#pragma once
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include "utils.h"
enum timing_config {
TIMING_ACTIVATED = 1 << 0,
TIMING_DISPLAY_START = 1 << 1,
TIMING_DISPLAY_END = 1 << 2,
TIMING_DISPLAY_BOTH = 1 << 3
};
struct timing_fx {
struct timespec start;
enum timing_config config;
uint8_t activated_start;
char start_template[255], end_template[255];
};
struct timing_fx static_tfx;
void timing_fx_init(struct timing_fx* tfx, enum timing_config conf, char* startt, char* endt);
void timing_fx_start(struct timing_fx* tfx, ...);
double timing_fx_stop(struct timing_fx* tfx, ...);