mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 14:30:53 +08:00
Partially resolves issue #46 Use epoch milliseconds rather than seconds
This commit is contained in:
@@ -97,6 +97,12 @@ timespec diff(timespec start, timespec end)
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
long getEpochTime()
|
||||
{
|
||||
return std::time(0) * 1000;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void getTime(timespec* time)
|
||||
@@ -138,10 +144,14 @@ timespec diff(timespec start, timespec end)
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
long getEpochTime()
|
||||
{
|
||||
struct timeval tp;
|
||||
gettimeofday(&tp, NULL);
|
||||
long int ms = tp.tv_sec * 1000 + tp.tv_usec / 1000;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
int getEpochTime()
|
||||
{
|
||||
return std::time(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user