<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>what&amp;#39;s the differences between timer and work queue?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105556/what-s-the-differences-between-timer-and-work-queue</link><description>I used to use timer to check things after a period while using SDK. But some job doesn&amp;#39;t work in NCS, like disconnect, because the timer handler is an interrupt. So I used k_work_delayable to resolve the problem. 
 
 Compare timer to work, which one has</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Nov 2023 13:38:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105556/what-s-the-differences-between-timer-and-work-queue" /><item><title>RE: what's the differences between timer and work queue?</title><link>https://devzone.nordicsemi.com/thread/455132?ContentTypeID=1</link><pubDate>Fri, 10 Nov 2023 13:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99b38dbf-8995-4d17-a4b6-7f15fba7c2a3</guid><dc:creator>kfcube</dc:creator><description>&lt;p&gt;I see. thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the differences between timer and work queue?</title><link>https://devzone.nordicsemi.com/thread/455122?ContentTypeID=1</link><pubDate>Fri, 10 Nov 2023 13:11:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ac51350-df78-4833-a167-39c3edb680be</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;A work queue is a way to queue work to be done at a later point in a different thread, with or without a delay. Read more under &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/zephyr/kernel/services/threads/workqueue.html"&gt;Workqueue Threads&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A zephyr timer is a mechanism to measure time, that&amp;nbsp;threads can wait for or check, and you can have an expiry function that runs (as an interrupt). There are also other Zephyr API that relate to time, like&amp;nbsp;k_sleep(). Read more under &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/zephyr/kernel/services/timing/clocks.html"&gt;Kernel Timing&lt;/a&gt; and more specifically, &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/zephyr/kernel/services/timing/timers.html"&gt;Timers&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So while both can relate to time, they are different concepts. There are often many ways to achieve the same end goal, so there are times where you could just as well use one or the other mechanism (and others, where one is the only sensible or even possible).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>