Home > Backend Development > C++ > body text

## How Do Multimedia Timer Settings and System Time Resolution Affect GetSystemTimeAdjustment Results?

DDD
Release: 2024-10-25 02:57:02
Original
697 people have browsed it

##  How Do Multimedia Timer Settings and System Time Resolution Affect GetSystemTimeAdjustment Results?

Understanding GetSystemTimeAdjustment Results on Windows 7

Question 1: Relationship between Time Queries and System Time Update Intervals

Yes, your assumption is correct. If the system time is synchronized periodically, querying the system time should either result in no change or a change that is a multiple of the increment retrieved by GetSystemTimeAdjustment.

Question 2: Discrepancy in Time Adjustments

The difference in your testing results can be explained by the following:

  • Actual System Time Update Period: GetSystemTimeAdjustment does not provide the actual update period of the system time. Instead, it reports the interval at which the system clock is adjusted if time synchronization is configured.
  • Resolution of System Time Queries: GetSystemTimeAsFileTime provides the system time with a resolution of 100 nanoseconds. However, the actual system time update period (obtained via NtQueryTimerResolution) is typically around 15.625 milliseconds (100 nanoseconds * 156,250).
  • Effect of Multimedia Timer Interface: The multimedia timer interface (timeBeginPeriod) can set the timer period to values not obtainable through NtSetTimerResolution. This can influence the actual update period of the system time.

Summary:

GetSystemTimeAdjustment reports the interval for time adjustment, while NtQueryTimerResolution should be used to obtain the actual update period of the system time. Discrepancies in results can occur due to differences in resolution and the influence of multimedia timer settings.

The above is the detailed content of ## How Do Multimedia Timer Settings and System Time Resolution Affect GetSystemTimeAdjustment Results?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!