duzib
LARGE_INTEGER litmp;
LARGE_INTEGER qt1, qt2;
QueryPerformanceFrequency(&litmp); double dff = (double)litmp.QuadPart; QueryPerformanceCounter(&qt1); int *a = NULL; for (int i = 0; i < 700; ++i) { for (int j = 0; j < 700; ++j) { a = new int[4]; } } QueryPerformanceCounter(&qt2); float ms = ((float)qt2.QuadPart - (float)qt1.QuadPart) * 1000 / dff; cout<<"time cost: "<<ms<<endl; int *b; QueryPerformanceCounter(&qt1); b = new int[14 * 700 * 700]; QueryPerformanceCounter(&qt2); ms = ((float)qt2.QuadPart - (float)qt1.QuadPart) * 1000 / dff; cout<<"time cost: "<<ms<<endl;

分类:

技术点:

相关文章:

  • 2021-07-22
  • 2021-08-23
  • 2022-01-21
  • 2021-05-31
  • 2021-10-18
  • 2022-12-23
  • 2022-02-13
  • 2021-11-25
猜你喜欢
  • 2021-07-17
  • 2022-01-26
  • 2021-05-28
  • 2021-06-21
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
相关资源
相似解决方案