<?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>How can i calculate function execution time in IAR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20296/how-can-i-calculate-function-execution-time-in-iar</link><description>Hi, 
 I want to know what is my execution time for each function.
I am using nrf51822 chip and the IDE is IAR Embedded Workbench.
How can i calculate the execution time of each function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Mar 2017 16:04:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20296/how-can-i-calculate-function-execution-time-in-iar" /><item><title>RE: How can i calculate function execution time in IAR</title><link>https://devzone.nordicsemi.com/thread/79072?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 16:04:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe6bd915-b728-4fc5-98df-c41cfffe8d78</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;I&amp;#39;ve seen few articles from IAR. Haven&amp;#39;t tried myself, prefer GPIO.
&lt;a href="https://www.iar.com/support/resources/articles/how-to-measure-execution-time-with-cyclecounter/"&gt;link1&lt;/a&gt; &lt;a href="https://www.iar.com/contentassets/f6945b040d3e419b8e618bcb57f75e6c/how-to-measure-time-with-swo.pdf"&gt;link2&lt;/a&gt; &lt;a href="https://www.iar.com/support/resources/articles/techniques-for-measuring-the-elapsed-time/"&gt;link3&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i calculate function execution time in IAR</title><link>https://devzone.nordicsemi.com/thread/79071?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 14:04:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48143497-3886-494a-8418-c1ba2e92371a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t know if IAR has a special function to that, but some generic solutions are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Toggle a GPIO pin right before and after calling the function then use a logic analyzer to measure the time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;User a timer, capture the timer counter value before and after the execution.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>