mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-22 17:29:18 +01:00
Manually calculate device latency average
This commit is contained in:
parent
5d1b4b9a4f
commit
dedb1c9ad9
@ -741,6 +741,7 @@ namespace DS4Windows
|
||||
CRC32_POS_3 = BT_INPUT_REPORT_CRC32_POS + 3;
|
||||
int crcpos = BT_INPUT_REPORT_CRC32_POS;
|
||||
int crcoffset = 0;
|
||||
long latencySum = 0;
|
||||
|
||||
while (!exitInputThread)
|
||||
{
|
||||
@ -749,14 +750,16 @@ namespace DS4Windows
|
||||
|
||||
if (tempLatencyCount >= 20)
|
||||
{
|
||||
latencyQueue.Dequeue();
|
||||
latencySum -= latencyQueue.Dequeue();
|
||||
tempLatencyCount--;
|
||||
}
|
||||
|
||||
latencySum += this.lastTimeElapsed;
|
||||
latencyQueue.Enqueue(this.lastTimeElapsed);
|
||||
tempLatencyCount++;
|
||||
|
||||
Latency = latencyQueue.Average();
|
||||
//Latency = latencyQueue.Average();
|
||||
Latency = latencySum / tempLatencyCount;
|
||||
|
||||
if (conType == ConnectionType.BT)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user