我想计算在C中函数调用期间经过的时间,精度为1纳秒.
C中是否有可用的定时器功能?
如果是,请提供示例代码段.
伪代码
Timer.Start() foo(); Timer.Stop() Display time elapsed in execution of foo()
环境细节: - 在RHEL机器上使用gcc 3.4编译器
c profiling timer
c ×1
profiling ×1
timer ×1