From bf0b0fe11d8b301cdfcc6d13f12a778cdd1c14b5 Mon Sep 17 00:00:00 2001 From: Daniel Rugerio <50124185+darugeri@users.noreply.github.com> Date: Wed, 13 May 2020 16:23:40 -0700 Subject: Update to SysVAD, Wave test and public sample of KS Position Test (#496) * Update to Wave test and public sample of KS Position test. * Update to the SysVAD audio driver sample. * Add the PnpLockDown property. --- audio/tests/KSPosTst/timetest.cpp | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 audio/tests/KSPosTst/timetest.cpp (limited to 'audio/tests/KSPosTst/timetest.cpp') diff --git a/audio/tests/KSPosTst/timetest.cpp b/audio/tests/KSPosTst/timetest.cpp new file mode 100644 index 00000000..d8026716 --- /dev/null +++ b/audio/tests/KSPosTst/timetest.cpp @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------ +// +// Copyright (C) Microsoft Corporation. All rights reserved. +// +// Module Name: +// +// timetest.cpp +// +// Abstract: +// +// Functions to precisely measure time. +// +// ------------------------------------------------------------------------------- + +#include "PreComp.h" +#include + +// ------------------------------------------------------------------------------ +// returns millisecs +double tpQPC (void) +{ + static LARGE_INTEGER liFrequency = { 0 }; + static LARGE_INTEGER liStart = { 0 }; + static bool bInitialized = false; + + if (!bInitialized) + { + if (!QueryPerformanceFrequency(&liFrequency)) + { + throw ("QueryPerformanceFrequency failed"); + } + + if (!QueryPerformanceCounter(&liStart)) + { + throw ("QueryPerformanceCounter failed"); + } + + bInitialized = true; + } + + LARGE_INTEGER liNow = { 0 }; + + if (!QueryPerformanceCounter(&liNow)) + { + throw ("QueryPerformanceCounter failed"); + } + + // milliseconds since test start + return 1000.0 * (liNow.QuadPart - liStart.QuadPart) / liFrequency.QuadPart; +} -- cgit v1.3.1