With this patch, the number of digits to be printed in ')time' output is now configurable via:
)boot $timePrintDigits := 3 As we discussed before, this could be useful -- and after a few days testing, it is useful. - Qian diff --git a/src/interp/g-timer.boot b/src/interp/g-timer.boot index 326cf2d4..8fc2aa35 100644 --- a/src/interp/g-timer.boot +++ b/src/interp/g-timer.boot @@ -48,7 +48,7 @@ makeLongStatStringByProperty _ PUT(cl, classproperty, n + GET(cl, classproperty)) total := total + n name = 'other or flag ~= 'long => 'iterate - if n >= 0.01 then + if significantStat? n then str := makeStatString(str, n, name, flag) else insignificantStat := insignificantStat + n @@ -64,18 +64,21 @@ makeLongStatStringByProperty _ normalizeStatAndStringify t == FLOATP t => - t < 0.01 => '"0" - FORMAT(nil,'"~,2F",t) + not significantStat? t => '"0" + fmtStr := STRCONC('"~,", STRINGIMAGE $timePrintDigits, '"F") + FORMAT(nil, fmtStr, t) INTEGERP t => FORMAT(nil, '"~:d", t) STRINGIMAGE t makeStatString(oldstr,time,abb,flag) == - time < 0.01 => oldstr + not significantStat? time => oldstr opening := (flag = 'long => '"("; '" (") timestr := normalizeStatAndStringify time oldstr = '"" => STRCONC(timestr, opening, abb, '")") STRCONC(oldstr, '" + ", timestr, opening, abb, '")") +significantStat? t == t >= 0.1^$timePrintDigits + peekTimedName() == IFCAR $timedNameStack popTimedName() == @@ -100,6 +103,7 @@ stopTimingProcess name == DEFPARAMETER($oldElapsedSpace, 0) DEFPARAMETER($oldElapsedGCTime, 0.0) DEFPARAMETER($oldElapsedTime, 0.0) +DEFPARAMETER($timePrintDigits, 2) -- $timedNameStack is used to hold the names of sections of the -- code being timed. -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/72823816-c75f-46cd-8712-4c67d14f5133%40gmail.com.