|
From: Seth D. <set...@us...> - 2005-01-14 22:16:02
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22406/source Modified Files: opverbs.c Log Message: Profiler times the scripts in milliseconds, but the results have always been in ticks. Added an optional param, flUseMilliseconds, to just return the table of millisecond values. Default is false. If the value is false, convert all of the entries in the profiledata.variabledata table to ticks. Index: opverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/opverbs.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** opverbs.c 11 Jan 2005 22:48:09 -0000 1.5 --- opverbs.c 14 Jan 2005 22:15:52 -0000 1.6 *************** *** 2091,2094 **** --- 2091,2102 ---- + static boolean convertprofiletoticksvisit (hdlhashnode hnode, ptrvoid refcon) { + tyvaluerecord * val = &(**hnode).val; + + (*val).data.longvalue = ( ( (*val).data.longvalue * 3 ) / 50 ); + + return (true); + } + static boolean opstopprofileverb (hdltreenode hp1, tyvaluerecord *v) { *************** *** 2096,2099 **** --- 2104,2112 ---- 5.0.2b15 dmb: turn off profiling. If the user passes an address (not nil), we assign the profiledata table and remove it from the process. + + 2005-01-14 SMD: results are stored in milliseconds, but the return values + have been in ticks for a long time. So, added an optional param, + flUseMilliseconds. Default is false. If true, we convert the milliseconds + to ticks. */ *************** *** 2102,2109 **** bigstring bs; tyvaluerecord val; flnextparamislast = true; ! if (!getvarparam (hp1, 1, &ht, bs)) return (false); --- 2115,2130 ---- bigstring bs; tyvaluerecord val; + short ctconsumed = 1; + short ctpositional = 1; + tyvaluerecord vflusemilliseconds; /* for optional flUseMilliseconds param */ + + if (!getvarparam (hp1, 1, &ht, bs)) + return (false); + + setbooleanvalue (false, &vflusemilliseconds); flnextparamislast = true; ! if (!getoptionalparamvalue (hp1, &ctconsumed, &ctpositional, "\x11" "flUseMilliseconds", &vflusemilliseconds)) return (false); *************** *** 2116,2128 **** setnilvalue (&val); else setexternalvalue ((Handle) (**hp).hprofiledata, &val); hashtableassign (ht, bs, val); (**hp).hprofiledata = nil; ! } return (setbooleanvalue (true, v)); ! } /*opstopprofileverb*/ --- 2137,2157 ---- setnilvalue (&val); else + { + if (! vflusemilliseconds.data.flvalue) /* convert values to ticks */ + { + if (!hashtablevisit ((hdlhashtable) (**(**hp).hprofiledata).variabledata, &convertprofiletoticksvisit, (ptrvoid) nil)) + return (false); + } + setexternalvalue ((Handle) (**hp).hprofiledata, &val); + } hashtableassign (ht, bs, val); (**hp).hprofiledata = nil; ! } return (setbooleanvalue (true, v)); ! } /*opstopprofileverb*/ |