main.cpp

来自「3 bits 转化为 4bits」· C++ 代码 · 共 32 行

CPP
32
字号
#include <iostream>
#include <time.h>
#include <sys/timeb.h>

using namespace std;
#include "Nibble.h"

int main()
{
	CNibble nibble;

	char* pBuffer = new char[1024 * 1024];
	for(int i = 0; i < 1024 * 1024; i ++)
	{
		pBuffer[i] = 0;
	}
	char* rst = new char[2 * 1024 * 1024];

	struct _timeb tstruct;
	struct _timeb tstruct1;
	_ftime( &tstruct );
	for(i = 0; i < 100; i ++)
	{
		nibble.TransForm(pBuffer, 1024 * 1024, (char*) rst);
	}
	_ftime( &tstruct1 );
	long time1;
	time1 = tstruct1.time*1000 + tstruct1.millitm - tstruct.time*1000 - tstruct.millitm;
	cout<<time1<<endl;
//	delete pOutBuffer;
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?