qpSWIFT
A Sparse Quadratic Programming Solver
timer.h
Go to the documentation of this file.
1
2
#ifndef __TIMER_H__
3
#define __TIMER_H__
4
#include "GlobalOptions.h"
5
10
#if (defined _WIN32 || defined _WIN64 || defined _WINDLL )
11
12
/* Use Windows QueryPerformanceCounter for timing */
13
#include <windows.h>
16
typedef
struct
qp_timer
{
17
LARGE_INTEGER
tic
;
18
LARGE_INTEGER
toc
;
19
LARGE_INTEGER freq;
20
}
qp_timer
;
21
23
#elif (defined __APPLE__)
24
26
#include <mach/mach_time.h>
27
typedef
struct
qp_timer
{
28
uint64_t
tic
;
29
uint64_t
toc
;
30
mach_timebase_info_data_t tinfo;
31
}
qp_timer
;
32
33
34
35
#else
36
40
#include <time.h>
41
#include <sys/time.h>
42
43
typedef
struct
qp_timer
{
44
struct
timespec
tic
;
45
struct
timespec
toc
;
46
}
qp_timer
;
47
48
#endif
49
57
void
tic
(
qp_timer
* t);
58
67
qp_real
toc
(
qp_timer
* t);
68
#endif
69
/* END IFDEF __TIMER_H__ */
70
qp_timer
struct qp_timer qp_timer
qp_timer::tic
struct timespec tic
Definition:
timer.h:44
toc
qp_real toc(qp_timer *t)
timer toc functions, similar to matlab toc, returns the recorded time
Definition:
timer.c:53
qp_timer
Definition:
timer.h:43
qp_timer::toc
struct timespec toc
Definition:
timer.h:45
tic
void tic(qp_timer *t)
timer tic functions, similar to matlab tic, starts recording time from the instant the function is in...
Definition:
timer.c:46
include
timer.h
Generated by
1.8.17