- if ( fgState.Time.Set )
- {
-#if TARGET_HOST_UNIX_X11
- struct timeval now;
- long elapsed;
-
- gettimeofday( &now, NULL );
-
- elapsed = (now.tv_usec - fgState.Time.Value.tv_usec) / 1000;
- elapsed += (now.tv_sec - fgState.Time.Value.tv_sec) * 1000;
-
- return elapsed;
-#elif TARGET_HOST_WIN32
- return timeGetTime() - fgState.Time.Value;
-#elif TARGET_HOST_WINCE
- return GetTickCount() - fgState.Time.Value;
-#endif
- }
- else
- {
-#if TARGET_HOST_UNIX_X11
- gettimeofday( &fgState.Time.Value, NULL );
-#elif TARGET_HOST_WIN32
- fgState.Time.Value = timeGetTime ();
-#elif TARGET_HOST_WINCE
- fgState.Time.Value = GetTickCount();
-#endif
- fgState.Time.Set = GL_TRUE ;
-
- return 0 ;
- }