mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 15:26:53 +08:00
45 lines
673 B
C++
45 lines
673 B
C++
#ifndef OPENALPR_TIMING_H
|
|
#define OPENALPR_TIMING_H
|
|
|
|
#include <iostream>
|
|
#include <ctime>
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#ifdef WINDOWS
|
|
// Import windows only stuff
|
|
#include <windows.h>
|
|
#if _MSC_VER < 1900
|
|
struct timespec
|
|
{
|
|
time_t tv_sec; // Seconds - >= 0
|
|
long tv_nsec; // Nanoseconds - [0, 999999999]
|
|
};
|
|
#else
|
|
//#define timespec timeval
|
|
#endif
|
|
#else
|
|
#include <sys/time.h>
|
|
#endif
|
|
|
|
// Support for OS X
|
|
#ifdef __MACH__
|
|
#include <mach/clock.h>
|
|
#include <mach/mach.h>
|
|
#endif
|
|
|
|
namespace alpr
|
|
{
|
|
|
|
void getTimeMonotonic(timespec* time);
|
|
int64_t getTimeMonotonicMs();
|
|
|
|
double diffclock(timespec time1,timespec time2);
|
|
|
|
int64_t getEpochTimeMs();
|
|
|
|
}
|
|
|
|
#endif
|