gettime2.c

来自「数值算法库for Unix」· C语言 代码 · 共 21 行

C
21
字号
#include <NTL/config.h>#include <sys/time.h>#include <sys/resource.h>#if (defined(__cplusplus) && !defined(NTL_CXX_ONLY))extern "C" double _ntl_GetTime();#endifdouble _ntl_GetTime(void){   struct rusage used;   getrusage(RUSAGE_SELF, &used);   return (used.ru_utime.tv_sec + used.ru_stime.tv_sec +      (used.ru_utime.tv_usec + used.ru_stime.tv_usec) / 1e6);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?