Remove unused system utils functions

master
Piotr Dziwinski 2015-05-13 20:52:19 +02:00
parent ccaac2c544
commit 0ddfdebab3
8 changed files with 0 additions and 40 deletions

View File

@ -157,22 +157,6 @@ void CSystemUtils::CopyTimeStamp(SystemTimeStamp *dst, SystemTimeStamp *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)
{
long long exact = TimeStampExactDiff(before, after);

View File

@ -115,12 +115,6 @@ public:
//! Returns a time stamp associated with current time
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
/** The difference is \a after - \a before. */
TEST_VIRTUAL float TimeStampDiff(SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit = STU_SEC);

View File

@ -87,11 +87,6 @@ void CSystemUtilsLinux::GetCurrentTimeStamp(SystemTimeStamp *stamp)
clock_gettime(CLOCK_MONOTONIC_RAW, &stamp->clockTime);
}
long long CSystemUtilsLinux::GetTimeStampExactResolution()
{
return 1ll;
}
long long CSystemUtilsLinux::TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after)
{
return (after->clockTime.tv_nsec - before->clockTime.tv_nsec) +

View File

@ -45,7 +45,6 @@ public:
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
virtual long long GetTimeStampExactResolution() OVERRIDE;
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
virtual std::string GetSaveDir() OVERRIDE;

View File

@ -30,11 +30,6 @@ void CSystemUtilsOther::GetCurrentTimeStamp(SystemTimeStamp* stamp)
stamp->sdlTicks = SDL_GetTicks();
}
long long int CSystemUtilsOther::GetTimeStampExactResolution()
{
return 1000000ll;
}
long long int CSystemUtilsOther::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after)
{
return (after->sdlTicks - before->sdlTicks) * 1000000ll;

View File

@ -46,7 +46,6 @@ public:
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
virtual long long int GetTimeStampExactResolution() OVERRIDE;
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
virtual void Usleep(int usec) OVERRIDE;

View File

@ -83,11 +83,6 @@ void CSystemUtilsWindows::GetCurrentTimeStamp(SystemTimeStamp* stamp)
stamp->counterValue = value.QuadPart;
}
long long int CSystemUtilsWindows::GetTimeStampExactResolution()
{
return 1000000000ll / m_counterFrequency;
}
long long int CSystemUtilsWindows::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after)
{
float floatValue = static_cast<double>(after->counterValue - before->counterValue) * (1e9 / static_cast<double>(m_counterFrequency));

View File

@ -43,7 +43,6 @@ public:
virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE;
virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE;
virtual long long GetTimeStampExactResolution() OVERRIDE;
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE;
virtual std::string GetSaveDir() OVERRIDE;