Remove unused system utils functions
parent
ccaac2c544
commit
0ddfdebab3
|
@ -157,22 +157,6 @@ void CSystemUtils::CopyTimeStamp(SystemTimeStamp *dst, SystemTimeStamp *src)
|
||||||
*dst = *src;
|
*dst = *src;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CSystemUtils::GetTimeStampResolution(SystemTimeUnit unit)
|
|
||||||
{
|
|
||||||
unsigned long long exact = GetTimeStampExactResolution();
|
|
||||||
float result = 0.0f;
|
|
||||||
if (unit == STU_SEC)
|
|
||||||
result = exact * 1e-9;
|
|
||||||
else if (unit == STU_MSEC)
|
|
||||||
result = exact * 1e-6;
|
|
||||||
else if (unit == STU_USEC)
|
|
||||||
result = exact * 1e-3;
|
|
||||||
else
|
|
||||||
assert(false);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
float CSystemUtils::TimeStampDiff(SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit)
|
float CSystemUtils::TimeStampDiff(SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit)
|
||||||
{
|
{
|
||||||
long long exact = TimeStampExactDiff(before, after);
|
long long exact = TimeStampExactDiff(before, after);
|
||||||
|
|
|
@ -115,12 +115,6 @@ public:
|
||||||
//! Returns a time stamp associated with current time
|
//! Returns a time stamp associated with current time
|
||||||
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) = 0;
|
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) = 0;
|
||||||
|
|
||||||
//! Returns the platform's expected time stamp resolution
|
|
||||||
TEST_VIRTUAL float GetTimeStampResolution(SystemTimeUnit unit = STU_SEC);
|
|
||||||
|
|
||||||
//! Returns the platform's exact (in nanosecond units) expected time stamp resolution
|
|
||||||
virtual long long GetTimeStampExactResolution() = 0;
|
|
||||||
|
|
||||||
//! Returns a difference between two timestamps in given time unit
|
//! Returns a difference between two timestamps in given time unit
|
||||||
/** The difference is \a after - \a before. */
|
/** The difference is \a after - \a before. */
|
||||||
TEST_VIRTUAL float TimeStampDiff(SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit = STU_SEC);
|
TEST_VIRTUAL float TimeStampDiff(SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit = STU_SEC);
|
||||||
|
|
|
@ -87,11 +87,6 @@ void CSystemUtilsLinux::GetCurrentTimeStamp(SystemTimeStamp *stamp)
|
||||||
clock_gettime(CLOCK_MONOTONIC_RAW, &stamp->clockTime);
|
clock_gettime(CLOCK_MONOTONIC_RAW, &stamp->clockTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
long long CSystemUtilsLinux::GetTimeStampExactResolution()
|
|
||||||
{
|
|
||||||
return 1ll;
|
|
||||||
}
|
|
||||||
|
|
||||||
long long CSystemUtilsLinux::TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after)
|
long long CSystemUtilsLinux::TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after)
|
||||||
{
|
{
|
||||||
return (after->clockTime.tv_nsec - before->clockTime.tv_nsec) +
|
return (after->clockTime.tv_nsec - before->clockTime.tv_nsec) +
|
||||||
|
|
|
@ -45,7 +45,6 @@ public:
|
||||||
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
|
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
|
||||||
|
|
||||||
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
|
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
|
||||||
virtual long long GetTimeStampExactResolution() OVERRIDE;
|
|
||||||
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
|
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
|
||||||
|
|
||||||
virtual std::string GetSaveDir() OVERRIDE;
|
virtual std::string GetSaveDir() OVERRIDE;
|
||||||
|
|
|
@ -30,11 +30,6 @@ void CSystemUtilsOther::GetCurrentTimeStamp(SystemTimeStamp* stamp)
|
||||||
stamp->sdlTicks = SDL_GetTicks();
|
stamp->sdlTicks = SDL_GetTicks();
|
||||||
}
|
}
|
||||||
|
|
||||||
long long int CSystemUtilsOther::GetTimeStampExactResolution()
|
|
||||||
{
|
|
||||||
return 1000000ll;
|
|
||||||
}
|
|
||||||
|
|
||||||
long long int CSystemUtilsOther::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after)
|
long long int CSystemUtilsOther::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after)
|
||||||
{
|
{
|
||||||
return (after->sdlTicks - before->sdlTicks) * 1000000ll;
|
return (after->sdlTicks - before->sdlTicks) * 1000000ll;
|
||||||
|
|
|
@ -46,7 +46,6 @@ public:
|
||||||
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
|
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
|
||||||
|
|
||||||
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
|
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
|
||||||
virtual long long int GetTimeStampExactResolution() OVERRIDE;
|
|
||||||
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
|
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
|
||||||
|
|
||||||
virtual void Usleep(int usec) OVERRIDE;
|
virtual void Usleep(int usec) OVERRIDE;
|
||||||
|
|
|
@ -83,11 +83,6 @@ void CSystemUtilsWindows::GetCurrentTimeStamp(SystemTimeStamp* stamp)
|
||||||
stamp->counterValue = value.QuadPart;
|
stamp->counterValue = value.QuadPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
long long int CSystemUtilsWindows::GetTimeStampExactResolution()
|
|
||||||
{
|
|
||||||
return 1000000000ll / m_counterFrequency;
|
|
||||||
}
|
|
||||||
|
|
||||||
long long int CSystemUtilsWindows::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after)
|
long long int CSystemUtilsWindows::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after)
|
||||||
{
|
{
|
||||||
float floatValue = static_cast<double>(after->counterValue - before->counterValue) * (1e9 / static_cast<double>(m_counterFrequency));
|
float floatValue = static_cast<double>(after->counterValue - before->counterValue) * (1e9 / static_cast<double>(m_counterFrequency));
|
||||||
|
|
|
@ -43,7 +43,6 @@ public:
|
||||||
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
|
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
|
||||||
|
|
||||||
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
|
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
|
||||||
virtual long long GetTimeStampExactResolution() OVERRIDE;
|
|
||||||
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
|
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
|
||||||
|
|
||||||
virtual std::string GetSaveDir() OVERRIDE;
|
virtual std::string GetSaveDir() OVERRIDE;
|
||||||
|
|
Loading…
Reference in New Issue