giuliomoro@135: #include "Clock.h" giuliomoro@135: giuliomoro@135: namespace Clock giuliomoro@135: { giuliomoro@135: myClock_t getTimeUs(){ giuliomoro@135: struct timeval tv; giuliomoro@135: struct timezone tz; giuliomoro@135: int ret=gettimeofday(&tv, &tz); giuliomoro@135: if(ret == -1){ giuliomoro@135: printf("Error while getting time of the day\n"); giuliomoro@135: return -1; giuliomoro@135: } giuliomoro@135: myClock_t time=tv.tv_usec + tv.tv_sec*1e6; giuliomoro@135: // printf("Time is: %.6f\n", time/1000000.0); giuliomoro@135: // printf("Time is: %lld\n", time); giuliomoro@135: return time; giuliomoro@135: } giuliomoro@135: };