.
D 2007-10-27T12:08:24
J assignee kennykb
J cmimetype text/plain
J comment When\sworking\son\sperformance\smeasurements\sof\stiny\sbites\sof\scode\s(eg,\sindividual\sinstructions\sin\sTEBC)\sthe\sresolution\sof\sTclpGetClicks()\sis\ssometimes\sinsufficient.\sBut\sthe\splatform\smay\shave\sclick\ssources\sof\shigher\sresolution.\n\n*\sOSX\shas\sTclpGetWideClicks\swhich\s(I\sam\sassuming)\shas\shigher\sresolution\n\n*\sWindows\shas\sthe\sQueryPerformanceCounter\sfunction,\swhich\sis\sused\selsewhere\sin\stclWinTime.c\sbut\snot\sfor\sthis\spurpose\n\n*\son\sPentium\sand\slater\sx86\scpus\sthe\srdtsc\sopcode\sis\savailable.\sOn\slinux,\sthe\srdtscll\sfunction\smay\sor\smay\snot\sbe\savailable\sdepending\son\skernel\sconfig,\sbut\swe\scan\sdefine\sit\sas\n\n#define\sGetClicks(foo)\sdo\s{\\\n\s\s\suint32_t\s__a,__d;\s\\\n\s\s\sasm\svolatile("rdtsc"\s:\s"=a"\s(__a),\s"=d"\s(__d));\s\\\n\s\s\s(foo)\s=\s((unint64_t)__a)\s|\s(((uint64_t)__d)<<32);\s\\\n}\swhile(0)\n\n*\sother\splatforms?\n\nThe\slast\stwo\ssolutions\s(OSX\stoo?)\swould\srequire\sthat\sthe\sprocess\sbe\sconfined\sto\sa\ssingle\scpu\sto\sinsure\saccuracy,\sbut\swe\scan\sleave\sthat\sto\sthe\suser.
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter msofer
J subsystem 06.\sTime\sMeasurement
J title extend\sTclpGetWideClicks\sto\sother\splatforms
J type RFE
K 1821187fffffffffffffffffffffffffffffffff
U msofer
Z 06dc228c87b8ad7a7cd289d3097c7dd5