From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a447112bc8b81379 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 16 Feb 2005 20:33:33 -0600 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Ada, games and frame rate calculation References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Wed, 16 Feb 2005 20:33:34 -0600 NNTP-Posting-Host: 67.161.24.234 X-Trace: sv3-C4T5NSCdqYfhmdM9bKXyaL810wkHkg7WR0ZQ9dWPHu+WARf/+CAA0NbbYbq+AstzIbZHq3iinRbnT8V!tZFqAFx55fKjXc1NtrRlyYty6pA0s5ol1uqhM2qDWMyZ0zDboLcSKwSZbyVYEw== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.31 Xref: g2news1.google.com comp.lang.ada:8369 Date: 2005-02-16T20:33:34-06:00 List-Id: > You can read the clock with microsecond precision (on Windows and some > other platforms); you can only delay with an accuracy of about 10 > milliseconds (again on Windows). That depends on how you delay. There are Windows calls for delays, but you can also have a spin delay whose accuracy is limited by the clock tick, clock reading time, and maximum delay caused by other tasks. e.g. Go_Time := Ada.Calendar.Clock+0.000_058; -- delay 58.0 microseconds while Ada.Calendar.Clock < Go_Time loop delay 0.0;end loop; (But note this can fail on some motherboards where the clock jumps forward several seconds if you re-read it too fast.) Most, but IIRC not all, compilers' run-times will do a "delay 0.0;" very fast if nothing else needs to run. I believe the Janus system calls Windows for long delays but does its own task management for short delays.