diff --git a/src/global.h b/src/global.h index bdb12169..1124fe82 100755 --- a/src/global.h +++ b/src/global.h @@ -73,7 +73,7 @@ #define DEF_NET_BLOCK_SIZE_FACTOR 3 // maximum network buffer size (which can be chosen by slider) -#define MAX_NET_BUF_SIZE_NUM_BL 10 // number of blocks +#define MAX_NET_BUF_SIZE_NUM_BL 12 // number of blocks // default network buffer size #define DEF_NET_BUF_SIZE_NUM_BL 6 // number of blocks diff --git a/src/server.cpp b/src/server.cpp index a53c83ae..eb44ce3e 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -106,7 +106,7 @@ void CServer::Start() Timer.start ( MIN_BLOCK_DURATION_MS ); // init time for response time evaluation - TimeLastBlock = QTime::currentTime(); + TimeLastBlock = PreciseTime.elapsed(); RespTimeMoAvBuf.Reset(); } } @@ -173,12 +173,12 @@ void CServer::OnTimer() // update response time measurement ---------------------------------------- // add time difference - const QTime CurTime = QTime::currentTime(); + const int CurTime = PreciseTime.elapsed(); // we want to calculate the standard deviation (we assume that the mean // is correct at the block period time) - const double dCurAddVal = ( (double) TimeLastBlock.msecsTo ( CurTime ) - - MIN_BLOCK_DURATION_MS ); + const double dCurAddVal = + ( (double) ( CurTime - TimeLastBlock ) - MIN_BLOCK_DURATION_MS ); RespTimeMoAvBuf.Add ( dCurAddVal * dCurAddVal ); // add squared value diff --git a/src/server.h b/src/server.h index 401de0ff..98a2aadd 100755 --- a/src/server.h +++ b/src/server.h @@ -79,8 +79,9 @@ protected: CSocket Socket; // debugging, evaluating + CPreciseTime PreciseTime; CMovingAv RespTimeMoAvBuf; - QTime TimeLastBlock; + int TimeLastBlock; // logging CLogging Logging;