Closed uctakeoff closed 7 years ago
Mac OS X でビルドしたところ以下のようなエラーが出ました。
Time.cpp:51:19: error: use of undeclared identifier 'CLOCK_MONOTONIC'
そこで clock_gettime() のない環境や CLOCK_MONOTONIC の対応していない環境で、代わりにgettimeofday を使うように修正しました。
clock_gettime()
CLOCK_MONOTONIC
gettimeofday
clock_gettime()のある環境で clock_gettime() を使ってくれるかどうかは確認していません。
参考: https://linuxjm.osdn.jp/html/LDP_man-pages/man2/clock_gettime.2.html
high_resolution_clock で実装してみました。 特に問題がなければ、こちらでもいいのかなと思っています。
high_resolution_clock で実装したものを使用するようにしました。 ありがとうございました。
Mac OS X でビルドしたところ以下のようなエラーが出ました。
Time.cpp:51:19: error: use of undeclared identifier 'CLOCK_MONOTONIC'
そこで
clock_gettime()
のない環境やCLOCK_MONOTONIC
の対応していない環境で、代わりにgettimeofday
を使うように修正しました。clock_gettime()
のある環境でclock_gettime()
を使ってくれるかどうかは確認していません。参考: https://linuxjm.osdn.jp/html/LDP_man-pages/man2/clock_gettime.2.html