diff --git a/src/openalpr/alpr_impl.cpp b/src/openalpr/alpr_impl.cpp index 76977e7..156734d 100644 --- a/src/openalpr/alpr_impl.cpp +++ b/src/openalpr/alpr_impl.cpp @@ -294,6 +294,7 @@ cJSON* AlprImpl::createJsonObj(const AlprResult* result) root=cJSON_CreateObject(); cJSON_AddStringToObject(root,"plate", result->bestPlate.characters.c_str()); + cJSON_AddNumberToObject(root,"epoch_time", getEpochTime() ); cJSON_AddNumberToObject(root,"confidence", result->bestPlate.overall_confidence); cJSON_AddNumberToObject(root,"matches_template", result->bestPlate.matches_template); diff --git a/src/openalpr/support/timing.cpp b/src/openalpr/support/timing.cpp index 4cc7442..a633aef 100644 --- a/src/openalpr/support/timing.cpp +++ b/src/openalpr/support/timing.cpp @@ -139,3 +139,9 @@ timespec diff(timespec start, timespec end) } #endif + + +int getEpochTime() +{ + return std::time(0); +} diff --git a/src/openalpr/support/timing.h b/src/openalpr/support/timing.h index 7eb506a..b48e14d 100644 --- a/src/openalpr/support/timing.h +++ b/src/openalpr/support/timing.h @@ -2,6 +2,7 @@ #define TIMING_H #include +#include // Support for OS X #ifdef __MACH__ @@ -19,4 +20,6 @@ void getTime(timespec* time); double diffclock(timespec time1,timespec time2); +int getEpochTime(); + #endif