dNewton - resettimer, gettimeinmicroseconds

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

dNewton - resettimer, gettimeinmicroseconds

Postby Slick » Thu Apr 30, 2020 9:06 am

If on Android which breaks at this (line 240):

Code: Select all
#ifdef __linux__
      dAssert (0);

in the function:

Code: Select all
void dNewton::ResetTimer()
{
   m_frequency = 0;
   m_baseCount = 0;
   #ifdef _MSC_VER
      LARGE_INTEGER baseCount;
      LARGE_INTEGER frequency;
      QueryPerformanceFrequency(&frequency);
      QueryPerformanceCounter (&baseCount);
      m_baseCount = dLong (baseCount.QuadPart);
      m_frequency = dLong (frequency.QuadPart);
   #endif

   //#if (defined (_POSIX_VER) || defined (_POSIX_VER_64))
   #ifdef __linux__
      dAssert (0);
      //timespec ts;
      //clock_gettime(CLOCK_REALTIME, &ts); // Works on Linux
      //baseCount = ts.tv_nsec / 1000;
      //m_baseCount = dLong (ts.tv_sec) * 1000000 + ts.tv_nsec / 1000;
      m_baseCount  = 0;
   #endif

   #ifdef _MACOSX_VER
      timeval tp;
      gettimeofday(&tp, NULL);
      dLong microsecunds = ((dLong)tp.tv_sec) * 1000000 + tp.tv_usec;
      m_baseCount = microsecunds;
   #endif

   m_microseconds = GetTimeInMicrosenconds();
}


Should all of these be uncommented and the asserts removed?
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: dNewton - resettimer, gettimeinmicroseconds

Postby Julio Jerez » Wed May 06, 2020 6:12 pm

The past under Linux has to be implemented but I do not have a system to do it.
if you get teh assert is because is call is you system.

if you implement it, I add it to the build. but until some one write it the assert has to be there to show that is incomplete.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dNewton - resettimer, gettimeinmicroseconds

Postby Slick » Thu May 07, 2020 7:08 am

I'll try and do a pull request. The code that was there almost worked as is.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 18 guests