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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dbbb936609f82bbd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-09 12:03:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!sccrnsc01.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Time_Span and Hardware resolutions References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc01 1039464220 12.234.13.56 (Mon, 09 Dec 2002 20:03:40 GMT) NNTP-Posting-Date: Mon, 09 Dec 2002 20:03:40 GMT Organization: AT&T Broadband Date: Mon, 09 Dec 2002 20:03:40 GMT Xref: archiver1.google.com comp.lang.ada:31598 Date: 2002-12-09T20:03:40+00:00 List-Id: > I have a Ada.Real_Time.Time_Span parameter as an in parameter to a > procedure. >... > If I get 37 milliseconds as a parameter I must convert the value of that to > be in steps of 100 us (microseconds). How about: function Hardware_Ticks(T : in Ada.Real_Time.Time_Span) return Integer is begin return T/Ada.Real_Time.Microseconds(100); end Hardware_Ticks; or the obvious changes to round up instead of truncate.