本文整理汇总了C++中TimeStamp::initStamp方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeStamp::initStamp方法的具体用法?C++ TimeStamp::initStamp怎么用?C++ TimeStamp::initStamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeStamp
的用法示例。
在下文中一共展示了TimeStamp::initStamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testPerformance
void testPerformance()
{
const int loopCount = 1000000000; // sib uk bun => 10^9
uint32_t first = 0xF1;
uint32_t second = 0x02;
Hamming hamming;
double elapsedTime;
logging::info("\n\n\n");
TimeStamp timeStamp;
timeStamp.initStamp();
for(int i=0;i<loopCount;++i) {
first = (unsigned long)i;
hamming.distance( first, second );
}
elapsedTime = timeStamp.getStampSecond();
logging::info("32bit Elapsed time %f mSec", int(elapsedTime*1000));
uint64_t first64 = 0x0001000200010002LL;
uint64_t second64 = 0x1000200010002000LL;
timeStamp.initStamp();
for(int i=0;i<loopCount;++i) {
hamming.distance( first64, second64 );
}
elapsedTime = timeStamp.getStampSecond();
logging::info("64bit Elapsed time %f mSec", int(elapsedTime*1000));
uint128_t first128(first64, first64);
uint128_t second128(second64, second64);
timeStamp.initStamp();
for(int i=0;i<loopCount;++i) {
hamming.distance( first128, second128 );
}
elapsedTime = timeStamp.getStampSecond();
logging::info("128bit Elapsed time %f mSec", int(elapsedTime*1000));
uint256_t first256(first128, first128);
uint256_t second256(second128, second128);
timeStamp.initStamp();
for(int i=0;i<loopCount;++i) {
hamming.distance( first256, second256 );
}
elapsedTime = timeStamp.getStampSecond();
logging::info("256bit Elapsed time %f mSec", int(elapsedTime*1000));
uint512_t first512(first256, first256);
uint512_t second512(second256, second256);
timeStamp.initStamp();
for(int i=0;i<loopCount;++i) {
hamming.distance( first512, second512 );
}
elapsedTime = timeStamp.getStampSecond();
logging::info("512bit Elapsed time %f mSec", int(elapsedTime*1000));
};