Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 984535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:02:03+00:00 2026-05-16T05:02:03+00:00

The idea is that an existing project uses timeGetTime() (for windows targets) quite frequently.

  • 0

The idea is that an existing project uses timeGetTime() (for windows targets) quite frequently.

milliseconds = timeGetTime();

Now, this could be replaced with

double tmp = (double) lpPerformanceCount.QuadPart/ lpFrequency.QuadPart; 
milliseconds = rint(tmp * 1000);

with lpPerformanceCount.QuadPart and lpFrequency.QuadPart being taken from the use of a single call to QueryPerformanceCounter() and QueryPerformanceFrequency().

I know Windows’ internals are kind of voodoo, but can someone decipher which of the two is more accurate or/and has more overheads?

I suspect accuracy might be same but QueryPerformanceCounter might have less overheads. But I have no hard data to back it up.

Of course I wouldn’t be surprised if the opposite is true.

If overheads are tiny in any way I would be more interested on whether there’s any difference in accuracy.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:02:03+00:00Added an answer on May 16, 2026 at 5:02 am

    The accuracy of timeGetTime() is variable, based on the last used timeBeginPeriod. It will never be better than one millisecond. QueryPerformanceCounter is variable too, depending on hardware support. It will never be worse than about a microsecond.

    Neither of them have notable overhead, QPC is probably a bit heavier. Whether that’s significant to you is quite unclear from your question. I doubt it, but measure. With QPC.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing asp.net webforms project that uses Microsoft's Enterprise DAAB for the
I have an existing VB project that uses InstallShield to create the instalation files.
I have an existing (C# based) windows service that is derived from the Installer
I'm coding an app that uses an existing database, that database has some tables
I'm trying to open an existing project into Idea Community Edition (it is a
I have CSLA (1.x framework) objects from an existing project that I'm trying to
I have a project that I could sync with the svn server only at
I have a complex project that uses a Ruby::Rake system to generate java (and
I currently have existing Intellij IDEA projects that are tied to the SVN repository.
I am editing an existing project, and there was a bug being reported that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.