{"id":274,"date":"2012-07-09T16:22:24","date_gmt":"2012-07-09T07:22:24","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=274"},"modified":"2014-02-06T23:42:38","modified_gmt":"2014-02-06T14:42:38","slug":"%e5%87%a6%e7%90%86%e6%99%82%e9%96%93%e6%b8%ac%e5%ae%9a%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/try\/274\/","title":{"rendered":"\u51e6\u7406\u6642\u9593\u6e2c\u5b9a\u306e\u305f\u3081\u306e\u30af\u30e9\u30b9"},"content":{"rendered":"<p>\u524d\u306bQueryPerformanceCounter\u3092\u4e0a\u3052\u305f\u304c\u3001\u6bce\u5ea6\u6bce\u5ea6\u305d\u308c\u3092\u66f8\u3044\u3066\u3044\u304f\u306e\u3082\u9762\u5012\u306a\u306e\u3067\u3001\u30af\u30e9\u30b9\u306a\u3093\u304b\u3092\u4f5c\u3063\u3066\u307f\u305f\u3002\u30cf\u30f3\u30ac\u30ea\u30a2\u30f3\u547d\u540d\u898f\u7d04(\u30cf\u30f3\u30ac\u30ea\u30fc\u8a18\u6cd5)\u3063\u307d\u3044\u306e\u3067\u66f8\u3044\u3066\u307f\u308b\u3002<\/p>\n<p><!--more--><\/p>\n<h2 id=\"content_1_0\">\u30af\u30e9\u30b9  <a class=\"anchor_super\" id=\"k4860776\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-10%2F1#k4860776\" title=\"k4860776\"> <\/a><\/h2>\n<p>\u3053\u3093\u306a\u611f\u3058\u304b\u306a(Visual Studio 2005, Visual C++ 8\u5411\u3051\u304b\u306a\uff1f)<\/p>\n<pre>class CQueryPerformance\r\n{\r\nprivate:\r\n\r\n\tLARGE_INTEGER m_Freq;\r\n\tLARGE_INTEGER m_Begin;\r\n \tLARGE_INTEGER m_End;\r\n \r\npublic:\r\n \r\n\tCQueryPerformance()\r\n\t{\r\n\t\tQueryPerformanceFrequency( &amp;m_Freq );\r\n\r\n\t\tm_Begin.QuadPart = 0;\r\n\t\tm_End.QuadPart = 0;\r\n\t}\r\n\r\n\tvoid Update()\r\n\t{\r\n\t\tif( m_Begin.QuadPart == 0 )\r\n\t\t{\r\n\t\t\tQueryPerformanceCounter( &amp;m_Begin );\r\n\t\t}\r\n\t\telse\r\n\t\tif( m_End.QuadPart == 0 )\r\n\t\t{\r\n\t\t\tQueryPerformanceCounter( &amp;m_End );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tm_Begin.QuadPart = m_End.QuadPart;\r\n\t\t\tQueryPerformanceCounter( &amp;m_End );\r\n\t\t}\r\n\t}\r\n\r\n\tvoid Print()\r\n\t{\r\n\t\t_tprintf_s( _T( \"%f\" ), GetTime() );\r\n\t}\r\n\r\n\tdouble GetTime() const\r\n\t{\r\n\t\treturn ( double )( m_End.QuadPart - m_Begin.QuadPart ) \/ m_Freq.QuadPart;\r\n\t}\r\n};<\/pre>\n<p>\u8981\u306f\u3001QueryPerformanceFrequency\u3068\u304b.QuadPart\u3068\u304b\u66f8\u304f\u306e\u9762\u5012\u306a\u3093\u3067\u305d\u308c\u3092\u7c21\u5358\u306b\u3057\u3066\u307f\u305f\u3060\u3051\u306e\u30e9\u30c3\u30d1\u30fc\u7684\u306a\u3082\u306e\u3002\u308f\u308a\u3068\u30c1\u30a7\u30c3\u30af\u304c\u7518\u304f\u3066(m_Freq.QuadPart\u304c0\u3060\u3068devided by zero error\u3067\u3059\u3051\u3069)\u3069\u3063\u304b\u9593\u9055\u3048\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3051\u3069\u3001\u30c7\u30d0\u30c3\u30b0\u7528\u306b\u3067\u3082\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u306bQueryPerformanceCounter\u3092\u4e0a\u3052\u305f\u304c\u3001\u6bce\u5ea6\u6bce\u5ea6\u305d\u308c\u3092\u66f8\u3044 &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/try\/274\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-274","post","type-post","status-publish","format-standard","hentry","category-try"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/comments?post=274"}],"version-history":[{"count":4,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/274\/revisions"}],"predecessor-version":[{"id":3338,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/274\/revisions\/3338"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}