2021-01-05 09:56:54 +00:00
|
|
|
#ifndef donar_stopwatch
|
|
|
|
#define donar_stopwatch
|
2020-02-25 16:35:52 +00:00
|
|
|
|
|
|
|
#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];
|
|
|
|
};
|
|
|
|
|
2021-01-05 09:56:54 +00:00
|
|
|
struct timing_fx* static_tfx();
|
2020-02-25 16:35:52 +00:00
|
|
|
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, ...);
|
2021-01-05 09:56:54 +00:00
|
|
|
#endif
|