mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-30 00:15:47 -04:00
Added ChatServer and soePlatform
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#include "Statistics.h"
|
||||
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
namespace NAMESPACE
|
||||
{
|
||||
|
||||
#endif
|
||||
namespace Base
|
||||
{
|
||||
|
||||
CStatisticTimer::CStatisticTimer(bool running) :
|
||||
mTotal(0),
|
||||
mStart(getTimer()),
|
||||
mRunning(running)
|
||||
{
|
||||
}
|
||||
|
||||
double CStatisticTimer::GetTime()
|
||||
{
|
||||
uint64 total = mTotal;
|
||||
|
||||
if (mRunning)
|
||||
total += getTimer()-mStart;
|
||||
|
||||
return (double)((int64)(total/getTimerFrequency()));
|
||||
}
|
||||
|
||||
uint64 CStatisticTimer::GetFraction(uint32 fraction)
|
||||
{
|
||||
uint64 total = mTotal;
|
||||
|
||||
if (mRunning)
|
||||
total += getTimer()-mStart;
|
||||
|
||||
if (fraction == 0)
|
||||
return total;
|
||||
else
|
||||
return total/(getTimerFrequency()/fraction);
|
||||
}
|
||||
|
||||
};
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user