mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-30 04:54:20 +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;
|
CRC32_POS_3 = BT_INPUT_REPORT_CRC32_POS + 3;
|
||||||
int crcpos = BT_INPUT_REPORT_CRC32_POS;
|
int crcpos = BT_INPUT_REPORT_CRC32_POS;
|
||||||
int crcoffset = 0;
|
int crcoffset = 0;
|
||||||
|
long latencySum = 0;
|
||||||
|
|
||||||
while (!exitInputThread)
|
while (!exitInputThread)
|
||||||
{
|
{
|
||||||
@ -749,14 +750,16 @@ namespace DS4Windows
|
|||||||
|
|
||||||
if (tempLatencyCount >= 20)
|
if (tempLatencyCount >= 20)
|
||||||
{
|
{
|
||||||
latencyQueue.Dequeue();
|
latencySum -= latencyQueue.Dequeue();
|
||||||
tempLatencyCount--;
|
tempLatencyCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
latencySum += this.lastTimeElapsed;
|
||||||
latencyQueue.Enqueue(this.lastTimeElapsed);
|
latencyQueue.Enqueue(this.lastTimeElapsed);
|
||||||
tempLatencyCount++;
|
tempLatencyCount++;
|
||||||
|
|
||||||
Latency = latencyQueue.Average();
|
//Latency = latencyQueue.Average();
|
||||||
|
Latency = latencySum / tempLatencyCount;
|
||||||
|
|
||||||
if (conType == ConnectionType.BT)
|
if (conType == ConnectionType.BT)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user