#include #include #include #include #include #include uint32_t stampstart(); uint32_t stampstop(uint32_t ); uint32_t start, stop; uint32_t GetTimestamp() { struct timeval tv; struct timezone tz; struct tm *tm; uint32_t tms; gettimeofday(&tv, &tz); tm = localtime(&tv.tv_sec); tms = tm->tm_hour * 3600 * 1000 + tm->tm_min * 60 * 1000 + tm->tm_sec * 1000 + tv.tv_usec / 1000; return (tms); } uint32_t stampstart() { start = GetTimestamp(); return start; } uint32_t stampstop( uint32_t ref ) { stop = GetTimestamp(); fprintf(stderr, " %d ms \n", stop - ref); return stop; }