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:53:47 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20070629145838 dot B636E77471D at mail dot verex dot com>
On Jun 29, 2007, at 10:58 AM, joe at strout dot net wrote:

> I think it would be perfectly accurate to use Microseconds in
> combination with New Date.  Here's what I would do, off the top of my
> head:
>
> 1. In initialization, go into a tight loop where you repeatedly get  
> the
> New Date until you see Floor(TotalSeconds) change.
>
> 2. Immediately get the Microseconds value, and store it away.  Now you
> have a base Microseconds value aligned with clock seconds.
>
> 3. Now whenever you need a time to a 10th of a second, get a New Date,
> and get the Microseconds value.  From the latter subtract the base
> value you stored in step 2, divide this down to 10ths of a second, and
> take that mod 10.  That's your 10th of a second -- multiply by 0.1 and
> add to the TotalSeconds from the date.
>
> Cheers,
> - Joe

Joe,

Thanks, this is what Paul suggested.  Works 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>