36 #if defined(VL_PLATFORM_LINUX) || defined(VL_PLATFORM_MACOSX) 48 VL_DEBUG_SET_OBJECT_NAME()
50 for(
int i=0; i<VL_MAX_TIMERS; ++i)
53 #if defined(VL_PLATFORM_WINDOWS) 54 SYSTEMTIME local_time;
55 GetLocalTime(&local_time);
56 mYear = local_time.wYear;
57 mMonth = local_time.wMonth;
60 mHour = local_time.wHour;
64 #elif defined(__GNUG__) 67 tm* date = localtime( &secs );
69 mYear = date->tm_year + 1900;
73 mHour = date->tm_hour;
78 gettimeofday( &tv,
NULL );
89 #if defined(VL_PLATFORM_WINDOWS) 90 LARGE_INTEGER Frequency;
91 LARGE_INTEGER PerformanceCount;
92 BOOL has_timer = QueryPerformanceFrequency( &Frequency );
96 QueryPerformanceCounter( &PerformanceCount );
98 gStartTime = PerformanceCount.QuadPart;
102 gStartTime = GetTickCount();
104 #elif defined(__GNUG__) 106 gettimeofday( &tv,
NULL );
107 gStartTime = (
unsigned long long)tv.tv_sec * 1000000 + (
unsigned long long)tv.tv_usec;
121 #if defined(VL_PLATFORM_WINDOWS) 123 LARGE_INTEGER Frequency;
124 LARGE_INTEGER PerformanceCount;
125 BOOL has_timer = QueryPerformanceFrequency( &Frequency );
129 QueryPerformanceCounter( &PerformanceCount );
131 return (real)(PerformanceCount.QuadPart-
gStartTime)/Frequency.QuadPart;
137 #elif defined(__GNUG__) 139 gettimeofday( &tv,
NULL );
140 return ((
unsigned long long)tv.tv_sec * 1000000 + (
unsigned long long)tv.tv_usec -
gStartTime) * 0.000001f;
146 #if defined(VL_PLATFORM_WINDOWS) 148 #elif defined(__GNUG__) 149 usleep(milliseconds*1000);
Visualization Library main namespace.
unsigned long long gStartTime
real mStart[VL_MAX_TIMERS]
static real currentTime()
Seconds passed from an arbitrary origin QueryPerformanceFrequency should be called only once in the a...
static void sleep(unsigned int milliseconds)