[Openmcl-devel] high res timer for CCL

Alexander Repenning ralex at cs.colorado.edu
Sun Dec 7 23:07:03 PST 2008


This new version of the high resolution timer makes it simple to  
measure the time spent in s-expressions down to the microsecond  
level.  This version is integrated into CCL editor. Select an  
expression and get the time it takes  to run. Quite precise actually.

http://www.agentsheets.com/lisp/Clozure_CL/us%20Timer.lisp

The only shame is that there would be an even better time function,  
good old upTime, with nanosecond resolution. Here is some code:

#include <CoreServices/CoreServices.h>

int main(){
     AbsoluteTime start = UpTime();
     //Do stuff
     AbsoluteTime end = UpTime();

     Nanoseconds diffNS = AbsoluteDeltaToNanoseconds(end,start);
     long nanoseconds = UnsignedWideToUInt64(diffNS);


How would one translate this into CCL  code?

Alex





Prof. Alexander Repenning

University of Colorado
Computer Science Department
Boulder, CO 80309-430

vCard: http://www.cs.colorado.edu/~ralex/AlexanderRepenning.vcf





More information about the Openmcl-devel mailing list