Skip to content
Tcl Source Code Artifact [84d974606e]
Login

Artifact [84d974606e]

Artifact 84d974606e70acf83ed8e309b911cdfaf58d59c4:

Ticket change [84d974606e] - New ticket [3002022fffffffff|3002022fff] <i>clock microseconds broken on Windows</i>. by hgiese on 2010-05-15 07:25:38.
D 2010-05-15T07:25:38
J assignee kennykb
J cmimetype text/plain
J comment Hello\sout\sthere,\nI\sthink\sthat\s'clock\smicroseconds'\sis\sbroken\sunder\sWindows.\n\nThere\swas\srecently\sa\sthread\son\sclt\n\s\s\s\sclock\smicroseconds\swith\sresolution\sin\smilliseconds\nwhich\sstated\sthat\syou\sonly\sever\sget\sa\smillisecond\sresolution\s-\sthat\sis\syou\sget\svalues\slike\s1273904070156000\sor\s1273904072243000\sbut\snever\sany\svalue\sother\sthan\s'000'\sin\sthe\s3\slow\sorder\sdigits.\n\nI\scould\sverify\sthis\son\smy\sIntel\sCore\s2\sDuo\smachine\s-\sand\sit\sreally\ssurprised\sme,\sbecause\sin\sthe\spast\sI\shad\sbeen\susing\s'clock\smicroseconds'\sto\sget\sdetailed\stiming\sinformation\s-\sjust\snot\son\sthis\smachine.\sWhy\sdid\sTcl\slose\sthe\suseful\scapability?\n\nI\shad\sa\slook\sat\sthe\ssources\sand\sI\sam\snear\sto\scertain\sto\shave\sfound\sthe\sculprit:\sNativeGetTime\s(tclWinTime.c)\sis\sbroken.\n\nAnalysis:\nOn\sits\sfirst\sinvocation\sNativeGetTime\schecks\svia\sQueryPerformanceFrequency\swhether\sa\sperformance\scounter\sexists\s-\sso\sfar,\sso\sgood.\nHowever,\sif\sits\sfrequency\sis\s>\s15\sMHz\s(and\son\smy\smachine\sit\sis\s2.5\sGHz)\sit\senters\sa\scomplex\stest\swhich\scan\sresult\sin\sdeclaring\sthe\sperformance\scounter\sas\s'not\savailable',\sand\sthis\stest\sis\s"out\sof\sdate":\na)\sIn\sits\sfirst\spart\sit\sonly\saccepts\s'GenuineIntel'\s-\svery\sbad\sfor\sAMD\schips.\nb)\sIn\sits\ssecond\spart\sit\sseems\sto\snot\sbe\s'up\sto\sdate':\sApparently\sIntel\shas\sdefined\sdifferent\svalues\sfor\snewer\scores\swhich\sthis\stest\sdoes\snot\scheck\s-\shence\sthe\sfailure\son\snewer\smachines.\n\nPossible\ssolutions:\na)\sGet\srid\sof\sthis\ssecond\stest.\nWhat\sis\sthe\sscenario\swhere\sit\smakes\ssense\sto\sdeclare\sthe\sperformance\scounter\sto\snot\sbe\savailable,\seven\sif\sWindows\shas\sjust\stold\sus\sthe\sopposite?\nb)\sIf\swe\sneed\sto\skeep\sit,\sit\sneeds\sto\sbe\sbrought\sup\sto\sdate:\n-\sAccept\sother\sCPUs\sthan\sIntel\sonly,\sand\n-\sfor\seach\score\sof\sthe\sdifferent\svendors\sget\sthe\stests\sright\n\nI\sattach\sa\sC\sfile\swhich\swhich\sis\sself-contained\sand\swhich\sshows\sthe\srelevant\sinformation\s(frequency\sand\sregister\svalues)\s-\sthis\smay\smake\sit\seasier\sto\sget\sor\sverify\sthe\sdetails\sfor\sdifferent\scores.\nIf\sthere\sis\sa\sreason\sto\sgo\sroute\s(b)\sI\scould\sput\sthis\sfile\son\sthe\swiki\sand\swe\scould\sask\speople\son\sclt\sto\ssupport\sthis\sissue\sby\srunning\sit\son\sall\spossible\scores\s(that's\sthe\sreason\sit\sis\sself-contained\sand\sdoes\snot\sneed\sTcl's\ssources\sto\scompile\s-\shopefully\smakes\sit\sa\sbit\seasier).\n\nStill,\sthe\seasiest\sway\swould\sbe\sto\sjust\sdrop\sthe\ssecond\stest.\nBest\sregards\nHelmut\sGiese\n
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter hgiese
J subsystem 06.\sTime\sMeasurement
J title clock\smicroseconds\sbroken\son\sWindows
J type Bug
K 3002022fffffffffffffffffffffffffffffffff
U hgiese
Z 4d01001a29d2a26556f38d2fd97b7baa