Foros: ヘルプ (Thread #34963)

clx::timerについて (2014-01-24 16:12 by pine #71361)

clx::timerをWindowsで使っていて問題に直面しました。
この関数ですが内部でtimeGetTime()の戻り値をdoubleに変換しているようですが、これではWindows起動後24.9日あるいは49.7日経った時に符号が変わってしまうため、経過時間がとんでもない値になってしまいます。つまり、start時点のtimeGetTime()の戻り値が0x7FFFFFFFで、経過後の戻り値が0x80000000だったら、ということです。
内部ではDWORDのまま保持しておいて、DWORDのまま差分を取ってからdoubleに変換すべきだと思います。

Responder al #71361×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Entrar