{"id":3103,"date":"2013-09-27T07:00:00","date_gmt":"2013-09-27T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2013\/09\/27\/how-can-i-determine-how-responsive-my-application-is-to-input\/"},"modified":"2013-09-27T07:00:00","modified_gmt":"2013-09-27T07:00:00","slug":"how-can-i-determine-how-responsive-my-application-is-to-input","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20130927-00\/?p=3103","title":{"rendered":"How can I determine how responsive my application is to input?"},"content":{"rendered":"<p>A customer was adding diagnostics to their application and wanted to know if there was a way to detect that the application was being slow in processing its input. These sorts of delays manifest themselves to the end user as a sluggish application which is slow to respond to input events.\n They already had a watchdog timer that was reset every time their <code>Get&shy;Message<\/code> call returned a message, so they could capture stack traces if their application stopped processing messages for more than X&nbsp;milliseconds. They wanted to extend this diagnostic information to input delays.\n Fortunately, there&#8217;s an easy way to tell. The <code>Get&shy;Message&shy;Time<\/code> will tell you the time the message was added to the queue, so by subtracting that time from the current <code>Get&shy;Tick&shy;Count<\/code>, you can determine how long the input message sat in the queue. (Sent messages are not queued messages, so calling <code>Get&shy;Message&shy;Time<\/code> for a sent message doesn&#8217;t work.)\n There&#8217;s a catch, here, though.<\/p>\n<p> Since mouse messages are generated on demand, the <code>Get&shy;Message&shy;Time<\/code> for a <code>WM_MOUSE&shy;MOVE<\/code> message is usually &#8220;Just now.&#8221; (It could be older if you forced a mouse move message to be generated but left it in the queue.) To get the actual time the mouse moved, you need to <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2012\/03\/14\/10282406.aspx\"> use <code>Get&shy;Mouse&shy;Move&shy;Points&shy;Ex<\/code><\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A customer was adding diagnostics to their application and wanted to know if there was a way to detect that the application was being slow in processing its input. These sorts of delays manifest themselves to the end user as a sluggish application which is slow to respond to input events. They already had a [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-3103","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>A customer was adding diagnostics to their application and wanted to know if there was a way to detect that the application was being slow in processing its input. These sorts of delays manifest themselves to the end user as a sluggish application which is slow to respond to input events. They already had a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/3103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=3103"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/3103\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=3103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=3103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=3103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}