locked
Where is the WinRT HighPerformanceCounter ?

    Question

  • In the past I have used

            [DllImport("Kernel32.dll")]
            private static extern bool QueryPerformanceCounter(out long lpPerformanceCount);
            [DllImport("Kernel32.dll")]
            private static extern bool QueryPerformanceFrequency(out long lpFrequency);

    To get the hi res counter, now I'm trying to move to RT, but I can't find the equivalent. I see this page https://msdn.microsoft.com/en-us/library/windows/desktop/ms644904%28v=vs.85%29.aspx but that's just the Win32 C function, that I'm already using.

    I would expect that WinRT would provide timing functionality.

    Tuesday, March 3, 2015 1:57 PM

Answers

  • Hi Gavin,

    As I can see from the documentation you provided, this API is supported on Windows Store App.

    Try to create a C++/CX runtime component and ref it on your C# code, see this for more information: Walkthrough: Creating a basic Windows Runtime component in C++ and calling it from JavaScript or C#

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 4, 2015 7:26 AM
    Moderator

All replies

  • Hi Gavin,

    As I can see from the documentation you provided, this API is supported on Windows Store App.

    Try to create a C++/CX runtime component and ref it on your C# code, see this for more information: Walkthrough: Creating a basic Windows Runtime component in C++ and calling it from JavaScript or C#

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 4, 2015 7:26 AM
    Moderator
  • Thanks, I was hoping i was just a bad searcher. It would be great if core functionality like this was brought upto date.
    Thursday, March 5, 2015 3:28 AM