INGOR
Loading...
Searching...
No Matches
ytTimer.h
1/*
2 util/ytTimer.{h,c} : Timer functions
3 Copyright (C) 2016 Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8
9#ifndef __YTLIB_TIMER_H
10#define __YTLIB_TIMER_H
11
12#ifndef _WIN64
13#include <sys/time.h>
14#else
15#include "win/systime.h"
16#endif
17#include <time.h>
18#include <stdio.h>
19
29
30typedef struct ytTimer_t ytTimer;
31
32ytTimer * ytTimer_new();
33void ytTimer_delete(ytTimer * timer);
34void ytTimer_enableSector(ytTimer * this);
35void ytTimer_set_type(ytTimer * timer, ytTimer_type type);
37 ytTimer_get_type(const ytTimer * timer);
38
39void ytTimer_start(ytTimer * timer);
40void ytTimer_start_type(ytTimer * timer, ytTimer_type type);
41void ytTimer_stop(ytTimer * timer);
42void ytTimer_stopLap(ytTimer * this);
43void ytTimer_clear(ytTimer * timer);
44void ytTimer_clearStart(ytTimer * timer);
45
46double ytTimer_get(const ytTimer * timer);
47double ytTimer_lap(ytTimer * timer);
48void ytTimer_sector(ytTimer * this);
49double ytTimer_get_avg_lap(const ytTimer * timer);
50double ytTimer_getTime();
51void ytTimer_printDDHHMMSS(ytTimer * timer, FILE * fp);
52void ytTimer_printDDHHMMSSsec(FILE * fp, double seconds);
53void ytTimer_printDDHHMMSSSSSsec(FILE * fp, double seconds);
54void ytTimer_printDDHHMMSSSSS(const ytTimer * timer, FILE * fp);
55void ytTimer_print(const ytTimer * this, FILE * fp);
56
57typedef struct ytTimer_t ytTimer;
58
59#endif /* __YTLIB_TIMER_H */
60
61/* End of file. */
Structure for Timer functions.
ytTimer_type
Timer types.
Definition ytTimer.h:23
@ ytTimer_NORMAL
Definition ytTimer.h:25
@ ytTimer_CLOCK
timer based on CPU clocks
Definition ytTimer.h:27