ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

microsecond-accurate timing on Windows
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Martin Sedlak



Joined: 26 Nov 2010
Posts: 701

PostPost subject: Re: microsecond-accurate timing on Windows    Posted: Mon May 28, 2012 3:22 pm Reply to topic Reply with quote

diep wrote:
from what i understand GetTickCount() in kernel of windows is a simple register move. so it gives time in milliseconds but should be accurate at several nanoseconds, as the latency between the register move and when you receive it is really little. The explanation for that is a plausible one.

With an atomic clock attached you can measure the real accuracy.

Vincent


I'm not sure how it's implemented. Probably it uses some counter which gets incremented on hardware timer interrupt, who knows.
But the problem with GetTickCount is that it has a resolution/granularity of ~16 milliseconds which makes it useless for most practical purposes. Actually IMO resolution worse than 5 msecs is useless for any realtime application.

After lots of googling I figured out that QPC is not stable on all systems. Lots of people reported instability on some systems (multicore or powersaving), which would mean it uses TSC anyway which of course won't work under these conditions. So I'm definitely dropping QueryPerformanceCounter and switching to timeGetTime. I believe it has 1 msec accuracy on most Windows systems today anyway.
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 10:20 am
      Re: microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 12:56 pm
      Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon May 28, 2012 2:44 pm
            Re: microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 3:22 pm
                  Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon May 28, 2012 3:30 pm
                        Re: microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 5:10 pm
                              Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon May 28, 2012 7:05 pm
            Re: microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 3:36 pm
                  Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon May 28, 2012 3:39 pm
                        Re: microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 5:20 pm
                              Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon May 28, 2012 6:23 pm
                                    Re: microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 7:13 pm
                                          Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon May 28, 2012 7:18 pm
                                                Re: microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 8:33 pm
                                                      Re: microsecond-accurate timing on Windows Aleks Peshkov Tue May 29, 2012 7:50 am
                                                            Re: microsecond-accurate timing on Windows Martin Sedlak Tue May 29, 2012 8:26 am
                                          Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon May 28, 2012 7:37 pm
                                                Re: microsecond-accurate timing on Windows Martin Sedlak Mon May 28, 2012 8:07 pm
                                                      Re: microsecond-accurate timing on Windows Vincent Diepeveen Tue May 29, 2012 12:44 pm
                                                            Re: microsecond-accurate timing on Windows Martin Sedlak Tue May 29, 2012 1:15 pm
                                                                  Re: microsecond-accurate timing on Windows Vincent Diepeveen Tue May 29, 2012 3:07 pm
                                                                        Re: microsecond-accurate timing on Windows Martin Sedlak Tue May 29, 2012 4:38 pm
                                                      Re: microsecond-accurate timing on Windows Vincent Diepeveen Tue May 29, 2012 12:55 pm
                                                      Re: microsecond-accurate timing on Windows Vincent Diepeveen Tue May 29, 2012 1:11 pm
                                                            Re: microsecond-accurate timing on Windows Martin Sedlak Tue May 29, 2012 1:29 pm
                                                                  Re: microsecond-accurate timing on Windows Vincent Diepeveen Tue May 29, 2012 3:18 pm
                                                                        Re: microsecond-accurate timing on Windows Martin Sedlak Tue May 29, 2012 5:00 pm
                                                                              Re: microsecond-accurate timing on Windows Wylie Garvin Tue May 29, 2012 9:38 pm
                                                                                    Re: microsecond-accurate timing on Windows Vincent Diepeveen Tue May 29, 2012 9:48 pm
                                                                                          Re: microsecond-accurate timing on Windows Martin Sedlak Wed May 30, 2012 9:10 am
                                                                                          Re: microsecond-accurate timing on Windows Vincent Diepeveen Fri Jun 01, 2012 9:24 am
                                                                                          Re: microsecond-accurate timing on Windows Martin Sedlak Fri Jun 01, 2012 10:52 am
                                                                                          Re: microsecond-accurate timing on Windows Vincent Diepeveen Sat Jun 02, 2012 3:36 pm
                                                                                          Re: microsecond-accurate timing on Windows Martin Sedlak Sun Jun 03, 2012 7:45 am
                                                                                          Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon Jun 04, 2012 11:25 am
                                                                                          Re: microsecond-accurate timing on Windows Vincent Diepeveen Mon Jun 04, 2012 11:39 am
                                                                                          Re: microsecond-accurate timing on Windows Martin Sedlak Mon Jun 04, 2012 12:31 pm
                                                                                          Re: microsecond-accurate timing on Windows Martin Sedlak Mon Jun 04, 2012 12:12 pm
                                                                                    Re: microsecond-accurate timing on Windows Martin Sedlak Wed May 30, 2012 9:13 am
                                                                                          Re: microsecond-accurate timing on Windows Vincent Diepeveen Fri Jun 01, 2012 9:29 am
                                                                        Re: microsecond-accurate timing on Windows Martin Sedlak Tue May 29, 2012 5:25 pm
                                                                              Re: microsecond-accurate timing on Windows Vincent Diepeveen Tue May 29, 2012 7:19 pm
                                                                                    Re: microsecond-accurate timing on Windows Martin Sedlak Wed May 30, 2012 11:41 am
                                                                                          Re: microsecond-accurate timing on Windows Thomas Petzke Wed May 30, 2012 2:57 pm
                                                                              Re: microsecond-accurate timing on Windows Vincent Diepeveen Tue May 29, 2012 7:27 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads