Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7df48e2701f73fd45ffbc5e68f1e6cd82072f7c6
Ticket: 1821187fffffffffffffffffffffffffffffffff
extend TclpGetWideClicks to other platforms
User & Date: das on 2007-11-06 12:26:59
Changes

  1. icomment:
    Logged In: YES 
    user_id=90580
    Originator: NO
    
    On OSX, TclpGetWideClicks() is based on mach_absolute_time() which is the highest resolution timer available on OSX in a processor-independent fashion. It runs at the CPU bus frequency and is incremented independently of multiple cores/CPUs or speedstep and the like. The frequency can be determined via mach_timebase_info(), allowing conversion of wide clicks to nanonseconds in TclpWideClicksToNanoseconds()  - which is used by [time] on OSX (for docs c.f. http://developer.apple.com/qa/qa2004/qa1398.html).
    There are higher resolution processor-specific timers available, e.g. on the intel pentium m family there are the PMCs CPU_CLK_UNHALTED and CPU_CLK_UNHALTED.BUS (the latter independent of speedstep), my tclCHUDtime.tcl extension uses these to do higher-resolution timing, also c.f. there for the code to convert ticks of these timers to nanoseconds: http://rutherglen.ics.mq.edu.au/~steffen/tcltk/carboncritlib/tclCHUDtime.tcl
    
    
  2. login: "das"
  3. mimetype: "text/plain"
  4. username: "das"