Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/samples/android/tutorial-4-opencl/jni/common.hpp
16348 views
1
#include <android/log.h>
2
#define LOG_TAG "JNIpart"
3
//#define LOGD(...)
4
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
5
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
6
7
#include <time.h> // clock_gettime
8
9
static inline int64_t getTimeMs()
10
{
11
struct timespec now;
12
clock_gettime(CLOCK_MONOTONIC, &now);
13
return (int64_t) now.tv_sec*1000 + now.tv_nsec/1000000;
14
}
15
16
static inline int getTimeInterval(int64_t startTime)
17
{
18
return int(getTimeMs() - startTime);
19
}
20
21