realbasic-nug
[Top] [All Lists]

Re: Tenths of seconds in Date

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Tenths of seconds in Date
From: Dave Shirk <dave at pamlicosounds dot com>
Date: Sat, 30 Jun 2007 00:52:58 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <mailman dot 29708 dot 1183095662 dot 256 dot realbasic-nug at lists dot realsoftware dot com> <p06002048c2aac781dfef at [192 dot 168 dot 0 dot 100]>
On Jun 29, 2007, at 10:36 AM, Paul Rodman wrote:

> 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

Paul,

Thanks, that works fine.  I have incorporated that, and since my
app does so much at startup time, the extra time in a loop is fine.

Thanks,

Dave

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>