[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Timing Problems with DrScheme and Mac OS



Hi People,

I've got a problem with doing some timing under Mac OS 9 and especially the "current-milliseconds" and "time-apply" functions...

I've already asked someone else so here is a copy of my old message..

I really hope, some of you can help..

thank you,
Stefan Schadwinkel


> Hello,
> 
> i'm studying computer science in Germany, and i'm currently developing
software for some psychologists at our university. The development is done on my
own Linux-system, but the final version will be used on portable iMacs.
> 
> The problem we're facing is quite simple, we want an accurate time messurement
of the users keystrokes. (We show a word, the individual should hit a key and i
want to take the time between showing the word and the keystroke)
> 
> I have written two versions of this program, one using "current-milliseconds"
in some pseudocode:
> 
> time_before = current-milliseconds
> read key
> time = current-milliseconds - time_before
> 
> the second version uses "time-apply" and some tricky stuff to use this
function while getting the keystroke through mred-events .. 
> 
> I hope you're still listening, here's the problem:
> the results are most always divisible by 100, meaning, I get times like 600,
1100 and so on instead of expected values like 624, 1163. 
> 
> I can't track this problem further down, but it is definatly platform-specific
as both versions are working fine on my own system, using either Windows or
Linux.
> 
> Maybe there is some bug in the timing handlers of Mac-version of DrScheme.
> Also, trying to use a compiled version, disabling debuging, using mred without
drscheme, all have those silly problem.
> 
> I should say, that running "current-milliseconds" 6 times and displaying its
results shows something like this:
> 
> 387850
> 387850
> 387850
> 387850
> 387866
> 387866
> 
> mostly, the numbers are ending on 33, 66, 50..
> 
> well, this is much too inaccurate for our purposes, and I personally can't
believe that an iMac is not able to do millisecond measurements. 
> 
> Now I ask, if you got some hints or ideas to get accurate millisecond values..
I don't about care small inaccurancies, but it should be better than this one
tenth of second.
> 
> I am thinking about using "send-event" to get the milliseconds from an
AppleEvent, but since I don't know anything about Macs this is not so easy to
do.
> 
> Any help would be very very nice,
> thank you in advance,
> Stefan Schadwinkel
> 
>  
>  
> 
> 
> 
> 
> 
> 
> 
>  
> 

----- Ende der weitergeleiteten Nachricht -----