AnsweredAssumed Answered

_time_diff_milliseconds returns 0

Question asked by Nitin Harish on Nov 5, 2015
Latest reply on Nov 5, 2015 by Carlos_Musich

My BSP is set to 5msec with 200Hz alarm frequency.

 

I am trying to use this tiny piece of code to see if 1msec has passed or not (Is there any other way to attain this without re-compiling BSP with 1000Hz)

 

_time_get_ticks(&ticker_old);

while(1)

{

     _time_get_ticks(&ticker_new);

      int32_t timediff_msec = _time_diff_milliseconds(&ticker_new,&ticker_old, &overflow);

     if(timediff_msec >=1)

     {

          break;

     }

}

 

BUT "_time_diff_milliseconds" always returns 0...What am I doing wrong here ?

Outcomes