benikabocha / saba

OpenGL Viewer (OBJ PMD PMX)
MIT License
442 stars 60 forks source link

gettimeofday() 実装の追加 #1

Closed uctakeoff closed 7 years ago

uctakeoff commented 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_gettime() を使ってくれるかどうかは確認していません。

参考: https://linuxjm.osdn.jp/html/LDP_man-pages/man2/clock_gettime.2.html

benikabocha commented 7 years ago

high_resolution_clock で実装してみました。 特に問題がなければ、こちらでもいいのかなと思っています。

benikabocha commented 7 years ago

high_resolution_clock で実装したものを使用するようにしました。 ありがとうございました。