【发布时间】:2014-02-05 08:55:37
【问题描述】:
在我的项目中,我使用struct timespec 如下
struct timespec start, end;
clock_gettime(CLOCK_REALTIME,&start);
/* Do something */
clock_gettime(CLOCK_REALTIME,&end);
它返回一个值为((((unsigned64)start.tv_sec) * ((unsigned64)(1000000000L))) + ((unsigned64)(start.tv_nsec))))
谁能告诉我们为什么我们使用unsigned64 格式并帮助我详细了解这个结构?我在研究中使用此代码来计算代码执行时间的纳秒精度
【问题讨论】: