1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2021-11-27 13:17:44 +00:00
37 changed files with 527 additions and 111 deletions
+45
View File
@@ -944,6 +944,51 @@ int64 getCPUTickCount(void)
#endif
namespace internal {
class Timestamp
{
public:
const int64 zeroTickCount;
const double ns_in_ticks;
Timestamp()
: zeroTickCount(getTickCount())
, ns_in_ticks(1e9 / getTickFrequency())
{
// nothing
}
int64 getTimestamp()
{
int64 t = getTickCount();
return (int64)((t - zeroTickCount) * ns_in_ticks);
}
static Timestamp& getInstance()
{
static Timestamp g_timestamp;
return g_timestamp;
}
};
class InitTimestamp {
public:
InitTimestamp() {
Timestamp::getInstance();
}
};
static InitTimestamp g_initialize_timestamp; // force zero timestamp initialization
} // namespace
int64 getTimestampNS()
{
return internal::Timestamp::getInstance().getTimestamp();
}
const String& getBuildInformation()
{
static String build_info =