qxl-wddm-dod: Introduce TimeMeasurement class for timing debugging

In release build this class resolved to empty statements.
In debug build it is useful for measurement of execution time.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
yuri.benditovich@daynix.com 2017-04-01 19:40:30 +03:00 committed by Frediano Ziglio
parent 0987a61bff
commit d8e645c751

View File

@ -225,6 +225,41 @@ typedef struct _CURRENT_BDD_MODE
} FrameBuffer;
} CURRENT_BDD_MODE;
#if DBG
class TimeMeasurement
{
public:
TimeMeasurement()
{
Start();
}
void Start()
{
KeQuerySystemTime(&li1);
}
void Stop()
{
KeQuerySystemTime(&li2);
}
ULONG Diff()
{
return (ULONG)((li2.QuadPart - li1.QuadPart) / 10000);
}
protected:
LARGE_INTEGER li1;
LARGE_INTEGER li2;
};
#else
class TimeMeasurement
{
public:
TimeMeasurement() {}
void Start() {}
void Stop() {}
ULONG Diff() { return 0; }
};
#endif
class QxlDod;
class HwDeviceInterface {