From: Dave Shirk <dave at pamlicosounds dot com>
>
>On Jun 28, 2007, at 9:00 AM, Herd Richard Dr (ENV) wrote:
>
>> Yes. The TotalSeconds property of the Date class is a double.
>> So you can get timing to thousandths of a second. It's fine on
>> Windows
>> - I use it for timing spectral acquisition - but on OSX, you just
>> get .000 for the decimal part of the TotalSeconds (see bug report
>> http://www.realsoftware.com/feedback/viewreport.php?
>> reportid=bvroufal <https://ueaexchange.uea.ac.uk/exchweb/bin/
>> redir.asp?URL=http://www.realsoftware.com/feedback/viewreport.php?
>> reportid=bvroufal>
>> - even consider signing up for it and doubling the number of votes!
>>
>> Regards - Richard
>
>Richard,
>
>Thanks for the reply. I looked at your Report, and just so happens
>the folks
>at Real responded to it today. Total seconds as documented is not
>suppose
>to return any fraction of seconds. So it works correctly on the Mac.
>
>I still need a way to determine fractions of a second, and see no
>accurate
>way to accomplish it.
>
>I can fake it - but in this case it will not be good.
>
>Dave
How about something like this:
dim d,dmaster as date, tmaster as double
d=new Date
do
dmaster=new Date
loop until dmaster.TotalSeconds>d.TotalSeconds
tmaster=Microseconds
At that point you have a date/time (dmaster) pretty close to the
exact second, and tmaster as the equivalent # of microseconds.
Thereafter (assuming dmaster and tmaster are global), the current
date/time will be dmaster.Totalseconds + (Microseconds-tmaster)*1E-6,
accurate to (in theory) a microsecond. In practice a lot worse, but
probably less than 0.1 seconds.
Paul Rodman
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|