[racket] querying the machine's system time...

From: Rüdiger Asche (rac at ruediger-asche.de)
Date: Sat Jun 16 00:28:12 EDT 2012

oh I see - I fell into that trap before (with sleep) where the function 
naming/doc wording suggest a second granularity.  I should stop looking at 
function names and start looking at parameter types. Sorry for that and 
thanks again!

----- Original Message ----- 
From: "Matthew Flatt" <mflatt at cs.utah.edu>
To: "Rüdiger Asche" <rac at ruediger-asche.de>
Cc: <users at racket-lang.org>
Sent: Saturday, June 16, 2012 6:23 AM
Subject: Re: [racket] querying the machine's system time...


I'm confused by the question. Maybe you have and old version where 
'seconds->date' accepts only integers? The current version accepts a real, 
and so fractional seconds can be in the argument to 'seconds->date'.



On Jun 16, 2012, at 12:14 PM, Rüdiger Asche <rac at ruediger-asche.de> wrote:

> but is there a conversion function to the system time similar to 
> seconds->date for milliseconds (didn't find one in the docs)? Once more, 
> what I need to do is examine the timing relationship between different 
> applications one of which is Racket and the other isn't (but uses the 
> system clock on a fine granularity). Thus I need absolute timing in my 
> Racket app...
>
> Thanks!
>
> ----- Original Message ----- From: "Matthew Flatt" <mflatt at cs.utah.edu>
> To: "Rüdiger Asche" <rac at ruediger-asche.de>
> Cc: <users at racket-lang.org>
> Sent: Saturday, June 16, 2012 6:06 AM
> Subject: Re: [racket] querying the machine's system time...
>
>
> Use `current-inexact-millseconds' (and divide by 1000) instead of
> `current-seconds'.
>
> At Sat, 16 Jun 2012 06:03:30 +0200, Rüdiger Asche wrote:
>> I need a millisecond granularity though (or at least 100 ms) -
>> GetSystemTime() provides that...
>>
>> Thanks!
>>
>> ----- Original Message ----- From: "Matthew Flatt" <mflatt at cs.utah.edu>
>> To: "Rüdiger Asche" <rac at ruediger-asche.de>
>> Cc: <users at racket-lang.org>
>> Sent: Friday, June 15, 2012 10:53 PM
>> Subject: Re: [racket] querying the machine's system time...
>>
>>
>> I think you want `current-seconds' and `seconds->date' (where the
>> latter lets you pick local or UTC).
>>
>> At Fri, 15 Jun 2012 18:01:31 +0200, Rüdiger Asche wrote:
>> > Hi there,
>> >
>> > I need to compare time events in my Racket application against output > 
>> > from
>> > a
>> > third-party application that most probably uses GetsystemTime() or
>> > GetLocalTime() for its time stamps, so I need to access those functions 
>> >  > as
>> > well
>> > (or other functions that contain the same information).
>> >
>> > How do I do that? The docs don't yield anything in that vicinity.
>> >
>> > Thanks!
>> > ____________________
>> >   Racket Users list:
>> >   http://lists.racket-lang.org/users
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users


Posted on the users mailing list.