标签:
1.操作系统:Windows 7 64位旗舰版
2.电脑类型:笔记本电脑(戴尔 Precision 7510)
3.处理器:i7-6820HQ @ 2.70GHz 四核
4.内存:32GB
5.显卡:NVIDIA Quadro M1000M
6.编译环境:Microsoft Visual Studio 2015
7.项目配置:Debug x64
8.辅助工具:无
1.代码:
#define Loop 100000000 int* p; DWORD t1 = GetTickCount(); for (int i = 0; i < Loop; ++i) { p = new int; } DWORD t2 = GetTickCount(); DWORD t_new = t2 - t1; t1 = GetTickCount(); for (int i = 0; i < Loop; ++i) { p = (int*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(int)); } t2 = GetTickCount(); DWORD t_heap = t2 - t1; printf("new Time: %d \nHeapAlloc Time: %d", t_new, t_heap);
2.结果:
<未完待续>
标签:
原文地址:http://www.cnblogs.com/441397069Blog/p/5720860.html