45 #include <visp/vpTime.h>
46 #include <visp/vpDebug.h>
59 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
60 # include <sys/time.h>
89 LARGE_INTEGER time, frequency;
90 QueryPerformanceFrequency(&frequency);
91 if(frequency.QuadPart == 0){
92 return(timeGetTime());
95 QueryPerformanceCounter(&time);
96 return (
double)(1000.0*time.QuadPart/frequency.QuadPart);
98 #elif !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
101 return(1000.0*tp.tv_sec + tp.tv_usec/1000.0);
115 LARGE_INTEGER time, frequency;
116 QueryPerformanceFrequency(&frequency);
117 if(frequency.QuadPart == 0){
118 return(timeGetTime());
121 QueryPerformanceCounter(&time);
122 return (
double)(1000000.0*time.QuadPart/frequency.QuadPart);
128 return(1000000.0*tp.tv_sec + tp.tv_usec);
151 double timeCurrent, timeToWait;
154 timeToWait = t0 + t - timeCurrent;
156 if ( timeToWait <= 0. )
159 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
163 #elif defined(_WIN32)
171 timeToWait = t0 + t - timeCurrent;
173 }
while (timeToWait > 0.);
191 double t0, timeCurrent, timeToWait;
196 if ( timeToWait <= 0. )
199 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
203 #elif defined(_WIN32)
211 timeToWait = t0 + t - timeCurrent;
213 }
while (timeToWait > 0.);
238 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
239 usleep((
unsigned long )(t*1000));
240 #elif defined(_WIN32)
static double measureTimeMicros()
static void sleepMs(double t)
static double measureTimeMs()
static int wait(double t0, double t)
static double measureTimeSecond()
static double minTimeForUsleepCall