Skip to content

Commit

Permalink
[engine][linux]Fixed Issue #89
Browse files Browse the repository at this point in the history
  • Loading branch information
M-F-K committed Nov 14, 2012
1 parent a8d338d commit c09565a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
5 changes: 2 additions & 3 deletions IndieLib/common/src/PrecissionTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ double PrecissionTimer::getTicks() {

#ifdef PLATFORM_LINUX
clock_gettime(CLOCK_MONOTONIC, &linux_end);
uint64_t start_time = ((((uint64_t)linux_start.tv_sec) * 1000000000ULL) + (uint64_t) linux_start.tv_nsec);
uint64_t end_time = ((((uint64_t) linux_end.tv_sec) * 1000000000ULL) + (uint64_t) linux_end.tv_nsec);
_elapsedTime = end_time - start_time;
mFinalTime = ((((uint64_t) linux_end.tv_sec) * 1000000000ULL) + (uint64_t) linux_end.tv_nsec);
_elapsedTime = (mFinalTime - mStartTime) / 1000000.0f;
#endif
return(static_cast<double>(_elapsedTime));

Expand Down
19 changes: 10 additions & 9 deletions IndieLib/common/src/PrecissionTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ class PrecissionTimer {

private:
//----- INTERNAL VARIABLES -----
bool _highRes; //Using High-res timer?
bool _started; //Started status
bool _paused; //Paused Status
bool _highRes; //Using High-res timer?
bool _started; //Started status
bool _paused; //Paused Status

#ifdef PLATFORM_WIN32
__int64 mStartTime; //Start time(Windows- specific format...)
__int64 mFinalTime; //End time(Windows- specific format...)
__int64 _elapsedTime; //Elapsed time (Windows- specific format...)
__int64 mFrequency; //High-res timer frequency
__int64 mStartTime; //Start time (Windows- specific format...)
__int64 mFinalTime; //End time (Windows- specific format...)
__int64 _elapsedTime; //Elapsed time (Windows- specific format...)
__int64 mFrequency; //High-res timer frequency
#endif

#if defined (PLATFORM_IOS) || defined (PLATFORM_OSX)
Expand All @@ -91,8 +91,9 @@ class PrecissionTimer {
#endif

#ifdef PLATFORM_LINUX
uint64_t mStartTime;
uint64_t _elapsedTime; // TODO: not sure that this is the right type......
uint64_t mStartTime; //Start time (linux - specific)
uint64_t mFinalTime; //End time (linux - specific)
uint64_t _elapsedTime; //Elapsed time (linux - specific)
struct timespec linux_start, linux_end;
#endif

Expand Down

0 comments on commit c09565a

Please sign in to comment.