当前位置: 首页>>代码示例>>C++>>正文


C++ TimeStamp::initStamp方法代码示例

本文整理汇总了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));
};
开发者ID:taey16,项目名称:demon_11st,代码行数:59,代码来源:testHamming.cpp


注:本文中的TimeStamp::initStamp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。