Le 29 juin 07 à 16:58 Soir, joe at strout dot net a écrit:
> On Jun 29, 2007, at 03:44 UTC, Dave Shirk wrote:
>
>> 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.
>
> 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.
What about using the "ticks" property?
It was my first idea, but since no one suggests it, it has certainly
an issue.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
From Fri 29 Jun 2007 10:27:05 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
id 647DC30FE2E0; Fri, 29 Jun 2007 09:27:14 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
www.realsoftware.com
X-Spam-Level:
X-Spam-Status: No, score=-3.0 required=4.5 tests=ALL_TRUSTED,AWL,BAYES_00,
NO_REAL_NAME autolearn=ham version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
by xmail.realsoftware.com (Postfix) with ESMTP id 85B0C30FE2D6;
Fri, 29 Jun 2007 09:27:13 -0700 (PDT)
Received: from real-software-mini.local (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP id 9118C40CE03;
Fri, 29 Jun 2007 11:27:04 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
by lists.realsoftware.com (Postfix) with ESMTP id 9DF4C40CDF8
for <realbasic-nug at lists dot realsoftware dot com>;
Fri, 29 Jun 2007 11:27:00 -0500 (CDT)
Received: from [66.116.103.197] (localhost [127.0.0.1])
by mail.verex.com (Postfix) with SMTP id E749A7748CC
for <realbasic-nug at lists dot realsoftware dot com>;
Fri, 29 Jun 2007 10:27:05 -0600 (MDT)
Date: Fri, 29 Jun 2007 10:27:05 -0600
Subject: Re: Tenths of seconds in Date
From: joe at strout dot net
To: realbasic-nug at lists dot realsoftware dot com
In-Reply-To: <16D039AE-E46B-470B-911F-C4FE5909FE92 at tribu dot ch>
X-Mailer: VerEx Email Gateway
Message-Id: <20070629162705 dot E749A7748CC at mail dot verex dot com>
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com
On Jun 29, 2007, at 16:19 UTC, Arnaud Nicolet wrote:
> What about using the "ticks" property?
> It was my first idea, but since no one suggests it, it has certainly
> an issue.
No, you could probably do the same thing with Ticks. For some reason I
just trust Microseconds more when it comes to accuracy, but that's
probably just superstition.
Best,
- Joe
--
Joe Strout -- joe at strout dot net
Strout Custom Solutions, LLC
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|