Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QueryPerformanceFrequency can be different
Forum Updated to NodeBB v4.3 + New Features

QueryPerformanceFrequency can be different

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JinZeyu
    wrote on 1 Dec 2016, 08:29 last edited by
    #1

    I see QueryPerformanceFrequency was called only once in qelapsedtimer_win.cpp. In China running LuDaShi or some other software, QueryPerformanceFrequency has to be called every time because CPU clock speeds can be different!
    Once my recorder programme using QElapsedTimer::elapsed() was 5 times slow than the real world time, so it's 5 times faster when i play it back.

    P 1 Reply Last reply 1 Dec 2016, 20:22
    0
    • J JinZeyu
      1 Dec 2016, 08:29

      I see QueryPerformanceFrequency was called only once in qelapsedtimer_win.cpp. In China running LuDaShi or some other software, QueryPerformanceFrequency has to be called every time because CPU clock speeds can be different!
      Once my recorder programme using QElapsedTimer::elapsed() was 5 times slow than the real world time, so it's 5 times faster when i play it back.

      P Offline
      P Offline
      Paul Colby
      wrote on 1 Dec 2016, 20:22 last edited by Paul Colby 12 Jan 2016, 20:27
      #2

      Hi @JinZeyu, and welcome! :)

      I see QueryPerformanceFrequency was called only once in qelapsedtimer_win.cpp. ... QueryPerformanceFrequency has to be called every time because CPU clock speeds can be different!

      First up, that's a pretty advanced internal question, which might be better asked on the Qt dev mailing list.

      Having said that, (and I know nothing about this topic), the MSDN docs appear to disagree with you (emphasis mine):

      QueryPerformanceFrequency function

      Retrieves the frequency of the performance counter. The frequency of the performance counter is fixed at system boot and is consistent across all processors. Therefore, the frequency need only be queried upon application initialization, and the result can be cached.

      Cheers.

      1 Reply Last reply
      2
      • J Offline
        J Offline
        JinZeyu
        wrote on 2 Dec 2016, 02:55 last edited by
        #3

        @Paul-Colby thanks for your reply!
        I'm not sure why this happen, maybe something wrong at elsewhere. I can check it out ,em...(work work...)

        1 Reply Last reply
        0

        1/3

        1 Dec 2016, 08:29

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved