// TestUnsigned.cpp : Defines the entry point for the console application.
//
#include "stdafx.h" #include <time.h>
#define DUMBCOPY for(i=0; i<65536; i++) \ dest[i] = src[i]
#define SMARCOPY memcpy(dest,src,63336)
int _tmain(int argc, _TCHAR* argv[]) {
TCHAR src[65536]; TCHAR dest[35536]; int i,j;
clock_t begin; clock_t end;
begin = clock(); for (j=0;j<1000;j++) { //SMARCOPY;
DUMBCOPY; } end=clock();
printf("%d\n",end-begin); return 0; }
|
发现使用SMARCOPY所用的时间明显比DUMBCOPY的时间多
阅读(339) | 评论(0) | 转发(0) |