OUTPUT BUFFER:
package require Tcl 8.5 proc SearchInNamespace {nmsp} { global CmdList foreach n [namespace children $nmsp] { SearchInNamespace $n } lappend CmdList {*}[info commands "${nmsp}::*"] return $CmdList } set cin [info commands] foreach n [namespace children] { set cin [concat $cin {*}[SearchInNamespace $n]] } #puts "[join [lsort $cin] \n]" #exit trace add execution source enterstep timerEnter trace add execution source leavestep timerLeave variable timerStack {} variable DoIt 0 proc timerEnter {cmd op} { variable timerStack variable DoIt puts "[lindex $cmd 0]" if {[lindex $cmd 0] in $::cin || "::[lindex $cmd 0]" in $::cin} { set DoIt 0 } else { lappend timerStack [clock microseconds] set DoIt 1 } } proc timerLeave {cmd code result op} { variable timerStack variable DoIt if {! $DoIt} {return} set now [clock microseconds] set then [lindex $timerStack end] set timerStack [lrange $timerStack 0 end-1] if {![llength $timerStack]} { puts " $DoIt [expr {$now-$then}]: [lindex $cmd 0]" } set DoIt 0 } source [set argv [lassign $argv argv0];set argv0]