gettime4.cpp
来自「数值算法库for Windows」· C++ 代码 · 共 30 行
CPP
30 行
#include <NTL/config.h>
#include <time.h>
#if (defined(__cplusplus) && !defined(NTL_CXX_ONLY))
extern "C" double _ntl_GetTime();
#endif
double _ntl_GetTime(void)
{
static clock_t last_clock = 0;
static double acc = 0;
clock_t this_clock;
double delta;
this_clock = clock();
delta = (this_clock - last_clock)/((double)CLOCKS_PER_SEC);
if (delta < 0) delta = 0;
acc += delta;
last_clock = this_clock;
return acc;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?