<?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: _time_get - Problem (MCF52259 + MQX 3.5) in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182518#M2902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you work it out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I recall some problems similar to you in the past, but they were my code issues...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I have been working out the time difference (not sure if its better, but i know it works 100%):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_get(&amp;amp;StartTime);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Check the current time&lt;/P&gt;&lt;P&gt;... Do something that takes time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_get(&amp;amp;CurrentTime);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Check the current time&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_time_diff(&amp;amp;StartTime, &amp;amp;CurrentTime, &amp;amp;TimeDifference);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Time %u:%u`n", TimeDifference.SECONDS, TimeDifference.MILLISECONDS);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Mar 2010 09:05:13 GMT</pubDate>
    <dc:creator>CarlFST60L</dc:creator>
    <dc:date>2010-03-16T09:05:13Z</dc:date>
    <item>
      <title>_time_get - Problem (MCF52259 + MQX 3.5)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182517#M2901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem with the functions _time_get(), _time_get_elapsed(), _time_diff(). Sometimes, every 5 to 10 seconds, I get a wrong timestamp from these functions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;_time_get_elapsed(&amp;amp;start_time);

...

_time_get_elapsed(&amp;amp;end_time);
_time_diff(&amp;amp;start_time, &amp;amp;end_time, &amp;amp;diff_time);

printf("start_time.SECONDS = %u, start_time.MILLISECONDS = %u\n", start_time.SECONDS, start_time.MILLISECONDS );
printf("end_time.SECONDS   = %u, end_time.MILLISECONDS   = %u\n", end_time.SECONDS,   end_time.MILLISECONDS );
printf("diff_time.SECONDS  = %u, diff_time.MILLISECONDS  = %u\n", diff_time.SECONDS,  diff_time.MILLISECONDS );
 &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:33:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182517#M2901</guid>
      <dc:creator>sven_kaemmer</dc:creator>
      <dc:date>2020-10-29T09:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: _time_get - Problem (MCF52259 + MQX 3.5)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182518#M2902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you work it out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I recall some problems similar to you in the past, but they were my code issues...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I have been working out the time difference (not sure if its better, but i know it works 100%):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_get(&amp;amp;StartTime);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Check the current time&lt;/P&gt;&lt;P&gt;... Do something that takes time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_get(&amp;amp;CurrentTime);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Check the current time&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_time_diff(&amp;amp;StartTime, &amp;amp;CurrentTime, &amp;amp;TimeDifference);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Time %u:%u`n", TimeDifference.SECONDS, TimeDifference.MILLISECONDS);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 09:05:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182518#M2902</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2010-03-16T09:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: _time_get - Problem (MCF52259 + MQX 3.5)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182519#M2903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, but I do it in another way. I think, I've always tried your version, but sometimes (every few minutes) I get an error. Now I use tick_time-structs and functions and everything is ok. Perhaps there was another failure and your code would run also. Thanks for your replay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;_time_get_elapsed_ticks(&amp;amp;start_tick);...do something......_time_get_elapsed_ticks(&amp;amp;end_tick);_time_diff_ticks(&amp;amp;end_tick, &amp;amp;start_tick, &amp;amp;diff_tick);_ticks_to_time(&amp;amp;diff_tick, &amp;amp;diff_time);msec = (diff_time.SECONDS * 1000) + diff_time.MILLISECONDS;printf("...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:33:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182519#M2903</guid>
      <dc:creator>sven_kaemmer</dc:creator>
      <dc:date>2020-10-29T09:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: _time_get - Problem (MCF52259 + MQX 3.5)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182520#M2904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Guys, this can be some MQX bug, if you both encountered the same issue.&lt;/P&gt;&lt;P&gt;Nevertheless, I was running a test app here for 1 hour without the problem found.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Mar 2010 22:47:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182520#M2904</guid>
      <dc:creator>JuroV</dc:creator>
      <dc:date>2010-03-23T22:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: _time_get - Problem (MCF52259 + MQX 3.5)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182521#M2905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might be related.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started using _time_get and _time_to_date to create reporting timestamps, using the MCF52259 evb, but the result of _time_get was like a random number generator. I also tried after initializing with _time_set, but no change. Then I tried _time_get_ticks and _time_ticks_to_xdate, and this produces consistent results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 May 2010 05:57:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/time-get-Problem-MCF52259-MQX-3-5/m-p/182521#M2905</guid>
      <dc:creator>Class_Five</dc:creator>
      <dc:date>2010-05-19T05:57:36Z</dc:date>
    </item>
  </channel>
</rss>

