primitiveMillisecondClock usage (lots but why?)

Lex Spoon lex at cc.gatech.edu
Thu Jul 3 03:06:56 UTC 2003


John M McIntosh <johnmci at mac.com> wrote:
> Well let's see in my test image I see 453 calls to Time  
> millisecondClockValue per second when the image is IDLE.
> 

Let me just toss out that this can be an extremely cheap operation. 
Surely most platforms can arrange to get a timer interrupt every 10 ms? 
Or alternatively, they can read a timer without doing a system call?

I get a little more than a million executions per second, on a machine
that is actually doing the system call instead of using a timer
interrupt.  The timer-interrupt version should be even faster.  (Is
anyone using a VM that has that option compiled, or which does it by
default?)

[ 1000000 timesRepeat: [ Time millisecondClockValue ]] timeToRun
   790
   791
   787


While it's neat to think about where these calls are coming from, IMHO
it doesn't seem valuable to try and remove them.  If you want to speed
things up, try reducing the number of redundent things that get redrawn
for common operations in Morphic.  :)


Lex



More information about the Squeak-dev mailing list