通过MacPorts安装必要的库后,在Mac OS X上编写的程序编译时,出现此错误:
In function 'nanotime':
error: 'CLOCK_REALTIME' undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
似乎clock_gettime在Mac OS X中未实现。是否有另一种方法来获取纪元时间(以纳秒为单位)?不幸的gettimeofday是,以微秒为单位。
相关分类