HELP: clock_gettime() problem?
    Alex 
    kbyte at iol.pt
       
    Mon Mar  8 17:23:55 UTC 2004
    
    
  
Hi,
Do you know why clock_gettime() POSIX call always returns the same value?
See next example:
#include <bsp.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
...
  //GET START TIME
  clock_gettime( CLOCK_REALTIME, &start );
  
  clock_getres(CLOCK_REALTIME, &resolution);
  //Some active huge delay... 
  for(j=0;j<100000;j++)
  {
    for(i=0;i<1000000;i++)
      cI=cI%status;
  }
  //GET STOP TIME
  clock_gettime( CLOCK_REALTIME, ¤t );
...
Every time I execute the program I always get the following values:
start.tv_sec=567993600
start.tv_nsec=0
current.tv_sec=567993600
current.tv_nsec=0
Why?
Thanks a lot...
Alex
PS1: rtems version=4.6; bsp=pc686; in a i686 computer
PS2: the clock_getres(CLOCK_REALTIME,&resolution) call 
     returns tv_sec=0, tv_nsec=10.000.000
___________________________________________________________________________________________
IOL Flash. A net normal em versao acelerada.
Precisa de uma caixa de correio maior? Com o IOL Flash pode ter uma caixa com 21MB de espaco.
Saiba mais sobre o IOL Flash: http://www.iol.pt/central_utilizador/iol_flash/
    
    
More information about the users
mailing list