<?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>measuring elapsed time with app_timer_cnt_diff_compute()</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2478/measuring-elapsed-time-with-app_timer_cnt_diff_compute</link><description>I&amp;#39;d like to write some timestamps to a log variable in order to see how much time has elapsed between certain points in my code. app_timer.h has two functions that look suitable for this: 
 uint32_t app_timer_cnt_get(uint32_t * p_ticks);

uint32_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Jun 2017 12:46:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2478/measuring-elapsed-time-with-app_timer_cnt_diff_compute" /><item><title>RE: measuring elapsed time with app_timer_cnt_diff_compute()</title><link>https://devzone.nordicsemi.com/thread/9986?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 12:46:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8f6d83b-c9e6-43d4-a242-f3b612512fca</guid><dc:creator>Jonathan Dan</dc:creator><description>&lt;p&gt;@kerem Eliot is referring to the functions defined in &lt;code&gt;nrf_drv_clock.h&lt;/code&gt; (see &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fgroup__app__timer.html)"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: measuring elapsed time with app_timer_cnt_diff_compute()</title><link>https://devzone.nordicsemi.com/thread/9985?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2015 13:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e895044f-ffaa-46da-b431-225caa64090a</guid><dc:creator>kerem</dc:creator><description>&lt;p&gt;I could not quite follow how you get the &lt;code&gt;ticks_elapsed&lt;/code&gt;, can we summarize it as after you start the clock with &lt;code&gt;start_clock(void)&lt;/code&gt;, &lt;code&gt;app_timer_cnt_get(uint32_t * p_ticks)&lt;/code&gt; gives you the timer ticks since the clock has started. And dividing &lt;code&gt;p_ticks&lt;/code&gt; value by 32k gives you it&amp;#39;s equivalent value in seconds?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: measuring elapsed time with app_timer_cnt_diff_compute()</title><link>https://devzone.nordicsemi.com/thread/9984?ContentTypeID=1</link><pubDate>Thu, 08 May 2014 23:00:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5db7b97f-8137-42a5-906e-fd729f6fb823</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Scratch that, this was all down to a silly error in my arithmetic. This does indeed seem to work:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;float seconds_elapsed = (float)ticks_elapsed / (32 * 1000);&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>