{"id":67,"date":"2012-06-19T13:50:56","date_gmt":"2012-06-19T04:50:56","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=67"},"modified":"2014-02-06T23:42:41","modified_gmt":"2014-02-06T14:42:41","slug":"queryperformancecounter","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/try\/67\/","title":{"rendered":"QueryPerformanceCounter"},"content":{"rendered":"<p>SoundEngine\u3084Image Note\u3067\u306f\u82e5\u5e72\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u304c\u3042\u308b\u3002\u305d\u308c\u3067\u3082\u3001\u6614\u306a\u3089\u81a8\u5927\u306a\u6642\u9593\u304c\u304b\u304b\u3063\u305f\u3082\u306e\u3060\u304c\u3001\u6700\u8fd1\u306fCPU\u306a\u3069\u306e\u6027\u80fd\u304c\u98db\u8e8d\u7684\u306b\u5411\u4e0a\u3057\u51e6\u7406\u6642\u9593\u304c\u304b\u306a\u308a\u77ed\u304f\u306a\u3063\u305f\u3002<\/p>\n<p>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6539\u5584\u306e\u305f\u3081\u306b\u6614\u306f\u3001\u3088\u304fGetTickCount\u3084timeGetTime\u306a\u3069\u3067\u51e6\u7406\u6642\u9593\u3092\u8a08\u3063\u305f\u308a\u3057\u305f\u3082\u306e\u3060\u304c\u3001\u6700\u8fd1\u3067\u306fQueryPerformanceCounter\u3092\u4f7f\u3046\u3088\u3046\u3060(\u3068\u3044\u3046\u3088\u308a\u6700\u8fd1\u77e5\u3063\u305f\u3060\u3051)\u3002\u4eca\u56de\u306f\u3053\u308c\u306b\u3064\u3044\u3066\u3061\u3087\u3063\u3068\u5b9f\u9a13\u3057\u3066\u307f\u3088\u3046\u304b\u3068\u3002<\/p>\n<p><!--more--><\/p>\n<h2 id=\"content_1_0\">QueryPerformanceCounter  <a class=\"anchor_super\" id=\"x5ecd99f\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2006-12-15#x5ecd99f\" title=\"x5ecd99f\"> <\/a><\/h2>\n<p>\u5fc5\u8981\u306a\u30d8\u30c3\u30c0\u30fc\u306f\u3001windows.h\u3060\u3051\u306e\u3088\u3046\u3060\u3002#include &lt;windows.h&gt;\u3057\u3066\u3042\u3052\u308c\u3070\u3068\u308a\u3042\u3048\u305a\u3001LARGE_INTEGER\u3082QueryPerformanceCounter\u3082QueryPerformanceFrequency\u3082\u4f7f\u3048\u308b\u3002\u3068\u308a\u3042\u3048\u305a\u3001\u3053\u3093\u306a\u30b3\u30fc\u30c9\u3092\u4f5c\u3063\u3066\u307f\u305f\u3002<\/p>\n<p>[c]<br \/>\nLARGE_INTEGER freq;<br \/>\nLARGE_INTEGER begin;<br \/>\nLARGE_INTEGER end;<\/p>\n<p>QueryPerformanceFrequency( &amp;amp;freq );<br \/>\nQueryPerformanceCounter( &amp;amp;begin );<\/p>\n<p>Sleep( 1000 );<\/p>\n<p>QueryPerformanceCounter( &amp;amp;end );<\/p>\n<p>printf( &quot;%f\\n&quot;, ( double )( end.QuadPart &#8211; begin.QuadPart ) \/ freq.QuadPart );<br \/>\n[\/c]<\/p>\n<p>\u7d50\u679c\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u3063\u305f\u3002<\/p>\n<div style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/soundengine.jp\/backend\/?plugin=ref&amp;page=services%2Ftips%2F2006-12-15&amp;src=result.gif\" alt=\"result.gif\" height=\"111\" width=\"372\"><\/div>\n<p>\u3069\u3046\u3084\u3089\u3046\u307e\u304f\u884c\u3063\u305f\u3088\u3046\u3060\u3002(\u82e5\u5e72\u3001Visual C++\u3067Debug\u30e2\u30fc\u30c9\u306e\u65b9\u304cRelease\u30e2\u30fc\u30c9\u3088\u308a\u9045\u304f\u306a\u308b\u70b9\u306f\u7814\u7a76\u3057\u305f\u3044\u3068\u3053\u308d\u3067\u3042\u308b\u304c\u4eca\u56de\u306f\u3057\u306a\u3044\u3002)<\/p>\n<p>\u3055\u3066\u3001QueryPerformanceFrequency\u3067\u3059\u304c\u3001\u30ab\u30a6\u30f3\u30bf\u306e\u5468\u6ce2\u6570\u3068\u306e\u3053\u3068\u3089\u3057\u3044\u3002\u305f\u3060\u3001\u4e00\u4f53\u306a\u3093\u306e\u5024\u306a\u306e\u304b\u306f\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002\u81ea\u5206\u306e\u74b0\u5883(CPU 900MHz(<a href=\"http:\/\/crystalmark.info\/\" rel=\"nofollow\">Crystal CPUID<\/a>\u3067\u306f\u3001896.68MHz))\u3067\u306f\u30013579545\u3067\u3042\u3063\u305f\u3002\u304a\u3088\u305d4000\u500d\u3050\u3089\u3044\u3002<\/p>\n<p>\u305d\u3093\u306a\u308f\u3051\u3067\u30013579545\u3092Google\u3067\u691c\u7d22\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001<\/p>\n<blockquote>\n<p class=\"quotation\">\u203b3,579,545Hz\u306f\u3001ACPI\u30bf\u30a4\u30de\u30fc\u7531\u6765\u306e\u5024\u3002\u3053\u306e\u5468\u6ce2\u6570\u306f\u30c6\u30ec\u30d3\u653e\u9001\u306eNTSC\u306e\u8272\u526f\u642c\u9001\u6ce2\u5468\u6ce2\u6570\u3067\u3082\u3042\u308b\uff08\u767a\u632f\u5668\u304c\u5b89\u304f\u3001\u5165\u624b\u3057\u3084\u3059\u3044\uff09\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3042\u308b\u3002(\u5f15\u7528\u5143 <a href=\"http:\/\/homepage1.nifty.com\/toro\/dlw32api.html\" rel=\"nofollow\">TORO&#8217;s Data Library(Win32 API memo)<\/a>)<br \/>\n\u3053\u308c\u3067\u3084\u3063\u3068\u5fc3\u7f6e\u304d\u306a\u304f\u4f7f\u3048\u305d\u3046\u306a\u6c17\u306f\u3059\u308b\u3002\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_1\">\u74b0\u5883  <a class=\"anchor_super\" id=\"u6de6ef4\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2006-12-15#u6de6ef4\" title=\"u6de6ef4\"> <\/a><\/h2>\n<p>\u3061\u306a\u307f\u306b\u3053\u308c\u3089\u306e\u95a2\u6570\u306f\u3001\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u304c\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u4f7f\u3048\u306a\u3044\u3088\u3046\u3060\u3002\u305f\u3060\u3001\u95a2\u6570\u3068\u3057\u3066\u306f\u3001kernel32.dll\u306b\u3042\u308aWindows 95, Windows NT 3.1\u304b\u3089\u4f7f\u3048\u308b\u3088\u3046\u306a\u306e\u3067\u30ea\u30f3\u30af\u3059\u308b\u5206\u306b\u306f\u554f\u984c\u306a\u3055\u305d\u3046\u3067\u3042\u308b\u3002\u307e\u305f\u3001<a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/winui\/winui\/windowsuserinterface\/windowing\/timers\/timerreference\/timerfunctions\/queryperformancefrequency.asp\" rel=\"nofollow\">MSDN<\/a>\u3067\u306f\u3001<\/p>\n<blockquote>\n<p class=\"quotation\">The frequency cannot change while the system is running.<\/p>\n<\/blockquote>\n<p>\u3068\u66f8\u3044\u3066\u3044\u308b\u306e\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u52d5\u4f5c\u4e2d\u306f\u3053\u306e\u5468\u6ce2\u6570\u306f\u5909\u3048\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u3068\u306e\u3053\u3068\u3002<\/p>\n<p>\u307e\u305f\u3001\u6642\u9593\u3067\u306f\u306a\u304f\u30af\u30ed\u30c3\u30af\u6570\u3092\u53d6\u5f97\u3059\u308b<a href=\"http:\/\/soundengine.jp\/wordpress\/tips\/2012\/07\/17\/rdtscread-time-stamp-counter%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e5%8c%96\/\">rdtsc<\/a>\u306b\u3064\u3044\u3066\u3082\u5f8c\u3067\u8aac\u660e\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SoundEngine\u3084Image Note\u3067\u306f\u82e5\u5e72\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u304c\u3042\u308b\u3002\u305d\u308c &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/try\/67\/\">\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-67","post","type-post","status-publish","format-standard","hentry","category-try"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/67","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=67"}],"version-history":[{"count":9,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":3387,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/67\/revisions\/3387"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}