{"id":98185,"date":"2018-03-08T07:00:00","date_gmt":"2018-03-08T22:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=98185"},"modified":"2019-03-13T00:49:52","modified_gmt":"2019-03-13T07:49:52","slug":"20180308-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20180308-00\/?p=98185","title":{"rendered":"What&#8217;s the difference between CreateTimerQueueTimer and SetThreadpoolTimer?"},"content":{"rendered":"<p>A customer wanted to know what the difference is between <code>Create<\/code><code>Timer<\/code><code>Queue<\/code><code>Timer<\/code> and <code>Set<\/code><code>Threadpool<\/code><code>Timer<\/code>, and what factors they should consider when choosing between them. (The customer explained that their immediate need was to create a periodic timer that fires every five seconds. It is not critical that the timer fire exactly at five second intervals.) <\/p>\n<p>The <code>Create<\/code><code>Timer<\/code><code>Queue<\/code><code>Timer<\/code> function is a wrapper that calls <code>Set<\/code><code>Threadpool<\/code><code>Timer<\/code> under the covers, so at the end of the day, you&#8217;re using <code>Set<\/code><code>Threadpool<\/code><code>Timer<\/code> whether you like it or not. <\/p>\n<p>The <code>Create<\/code><code>Timer<\/code><code>Queue<\/code><code>Timer<\/code> function is just a compatibility function for programs written to the old thread pool API. <\/p>\n<p>The customer thanked us for the explanation and decided to go with <code>Set<\/code><code>Threadpool<\/code><code>Timer<\/code>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>They are both the same thing under the covers.<\/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-98185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>They are both the same thing under the covers.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/98185","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=98185"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/98185\/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=98185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=98185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=98185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}