Download
Magazine
Develop
Account
Download
Magazine
Develop
Login
Forgot Account/Password
Create Account
Language
Help
Language
Help
×
Login
Login Name
Password
×
Forgot Account/Password
Category:
Software
People
PersonalForge
Magazine
Wiki
Search
OSDN
>
Find Software
>
System
>
Networking
>
CLX C++ Libraries
>
Forums
>
ヘルプ
>
clx::timerについて
CLX C++ Libraries
Description
Project Summary
Developer Dashboard
Web Page
Developers
Image Gallery
List of RSS Feeds
Activity
Statistics
History
Downloads
List of Releases
Stats
Source Code
Code Repository list
Subversion
View Repository
Ticket
Ticket List
Milestone List
Type List
Component List
List of frequently used tickets/RSS
Submit New Ticket
Communication
List of Forums
ヘルプ (2)
公開討議 (19)
開発者 (24)
News
Forums:
ヘルプ
(Thread #34963)
Return to Thread list
RSS
clx::timerについて (2014-01-24 16:12 by
pine
#71361)
Reply
Create ticket
clx::timerをWindowsで使っていて問題に直面しました。
この関数ですが内部でtimeGetTime()の戻り値をdoubleに変換しているようですが、これではWindows起動後24.9日あるいは49.7日経った時に符号が変わってしまうため、経過時間がとんでもない値になってしまいます。つまり、start時点のtimeGetTime()の戻り値が0x7FFFFFFFで、経過後の戻り値が0x80000000だったら、ということです。
内部ではDWORDのまま保持しておいて、DWORDのまま差分を取ってからdoubleに変換すべきだと思います。
Reply to #71361
×
Subject
Body
Reply To Message #71361 > clx::timerをWindowsで使っていて問題に直面しました。 > この関数ですが内部でtimeGetTime()の戻り値をdoubleに変換しているようですが、これではWindows起動後24.9日あるいは49.7日経った時に符号が変わってしまうため、経過時間がとんでもない値になってしまいます。つまり、start時点のtimeGetTime()の戻り値が0x7FFFFFFFで、経過後の戻り値が0x80000000だったら、ということです。 > 内部ではDWORDのまま保持しておいて、DWORDのまま差分を取ってからdoubleに変換すべきだと思います。
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.)
Login
Nickname
Preview
Post
Cancel