几何尺寸与公差论坛

 找回密码
 注册
查看: 3707|回复: 2

统计运行效率

[复制链接]
发表于 2006-11-12 18:51:37 | 显示全部楼层 |阅读模式
代码一:
// compute the usage time when new or create part program
#ifdef _DEBUG
clock_t startClock = clock();
#endif
#ifdef _DEBUG
clock_t endClock = clock();
double elapsedTime = double(endClock - startClock) /CLOCKS_PER_SEC;
TRACE("New part program time: %.3lf sec\n", elapsedTime);
#endif
 楼主| 发表于 2006-11-12 18:52:50 | 显示全部楼层

回复: 统计运行效率

代码二:
#ifdef _DEBUG
SYSTEMTIME stStart;
ZeroMemory(&stStart, sizeof(SYSTEMTIME));
GetSystemTime(&stStart);
TRACE("__10Start__\n%d_%d_%d\n\n", stStart.wMinute,stStart.wSecond, stStart.wMilliseconds);
#endif
#ifdef _DEBUG
SYSTEMTIME stEnd;
ZeroMemory(&stEnd, sizeof(SYSTEMTIME));
GetSystemTime(&stEnd);
TRACE("__11End__\n%d_%d_%d\n\n", stEnd.wMinute,stEnd.wSecond, stEnd.wMilliseconds);
 楼主| 发表于 2006-12-8 10:19:22 | 显示全部楼层

回复: 统计运行效率

#ifdef _DEBUG
  clock_t startClock = clock();
  clock_t endClock = 0;
  double elapsedTime = 0;
#endif


#ifdef _DEBUG
  endClock = clock();
  elapsedTime = double(endClock - startClock) /CLOCKS_PER_SEC;
  TRACE("Import local coordinate systems  time: %.5lf sec\n", elapsedTime);
#endif
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-31 01:52 , Processed in 0.038335 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表