crashtest-r0ket/simulat0r/simcore/timecounter.c

12 lines
244 B
C
Raw Permalink Normal View History

2011-07-25 06:50:33 +00:00
#include <sys/time.h>
#include <stdint.h>
#include <stdlib.h>
volatile uint32_t _timectr; // to satisfy linker
volatile uint32_t simTimeCounter() {
struct timeval tv;
gettimeofday(&tv,NULL);
return (tv.tv_sec*1000000+tv.tv_usec)/100;
}