<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Measure execution time (MQX 4.1) in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389031#M12982</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;I think using the &lt;U&gt;time&lt;/U&gt;get_elapsed_ticks() function would work as it has the number of TICKS (5 msec) in a 64-bit variable since the beginning of MQX execution as well as a HWTICKS variable which is the number of hardware ticks that have occurred since the last TICK.&lt;/P&gt;&lt;P&gt;Calling it before and after your f(); should give you the time.&lt;/P&gt;&lt;P&gt;Please also look at this post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.freescale.com/thread/334266" target="test_blank"&gt;https://community.freescale.com/thread/334266&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Jan 2015 22:55:15 GMT</pubDate>
    <dc:creator>DavidS</dc:creator>
    <dc:date>2015-01-06T22:55:15Z</dc:date>
    <item>
      <title>Measure execution time (MQX 4.1)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389030#M12981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way of measuring the execution time of a function with nanosecond precision on MQX 4.1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have in mind is something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint32_t start = get_time ();&lt;/P&gt;&lt;P&gt;f();&lt;/P&gt;&lt;P&gt;uint32_t delta = get_time () - start;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, _time_get_nanoseconds () does not work for me because there is a timer interrupt during the execution of f().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 15:32:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389030#M12981</guid>
      <dc:creator>michael_wahler</dc:creator>
      <dc:date>2015-01-06T15:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Measure execution time (MQX 4.1)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389031#M12982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;I think using the &lt;U&gt;time&lt;/U&gt;get_elapsed_ticks() function would work as it has the number of TICKS (5 msec) in a 64-bit variable since the beginning of MQX execution as well as a HWTICKS variable which is the number of hardware ticks that have occurred since the last TICK.&lt;/P&gt;&lt;P&gt;Calling it before and after your f(); should give you the time.&lt;/P&gt;&lt;P&gt;Please also look at this post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.freescale.com/thread/334266" target="test_blank"&gt;https://community.freescale.com/thread/334266&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 22:55:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389031#M12982</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2015-01-06T22:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Measure execution time (MQX 4.1)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389032#M12983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response. Unfortunately, the resolution of your solution is only 5 milliseconds whereas I need microsecond (or better, nanosecond) precision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 08:40:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389032#M12983</guid>
      <dc:creator>michael_wahler</dc:creator>
      <dc:date>2015-01-07T08:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Measure execution time (MQX 4.1)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389033#M12984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the below thread&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/329944"&gt;Change MQX periodic timer period?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol &lt;BR /&gt; &lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 17:23:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389033#M12984</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2015-01-08T17:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Measure execution time (MQX 4.1)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389034#M12985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If possible, you could try to set a IO pin high before execute the funtion, set to low after the function. Use scope to measure the IO pin, this is the way I used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 18:16:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389034#M12985</guid>
      <dc:creator>michaelzhangca</dc:creator>
      <dc:date>2015-01-08T18:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Measure execution time (MQX 4.1)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389035#M12986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;Please have a look at my modified lwevent project source code attached to see if this resolves your issue.&lt;/P&gt;&lt;P&gt;My terminal output looks like:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14207411889761048" jivemacro_uid="_14207411889761048"&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:1Sec:999ms:998751us:998750808ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:2Sec:2217ms:2216541us:2216541475ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:2Sec:2771ms:2771294us:2771293975ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:3Sec:3326ms:3326289us:3326289333ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:1Sec:1661ms:1661286us:1661285900ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:3Sec:3881ms:3881293us:3881292742ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:0Sec:551ms:551269us:551269458ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:4Sec:4437ms:4436523us:141555812ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:1Sec:1106ms:1106352us:1106351800ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:4Sec:4991ms:4991266us:696298787ns&lt;/P&gt;
&lt;P&gt; Tick &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;0Min:0Sec:996ms:996351us:996350950ns&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 18:20:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Measure-execution-time-MQX-4-1/m-p/389035#M12986</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2015-01-08T18:20:15Z</dc:date>
    </item>
  </channel>
</rss>

