diff options
author | gahr <gahr@gahr.ch> | 2016-05-03 19:50:15 (GMT) |
---|---|---|
committer | gahr <gahr@gahr.ch> | 2016-05-03 19:50:15 (GMT) |
commit | df18ecdce0832c7722af0396d30c814d1cebe3a3 (patch) | |
tree | c5cd3ada2f2a6010ca75ab0bb72a2b64ada44efc /library/tcltest | |
parent | c313e3796872bbec3198b5a607059e96767311b2 (diff) | |
download | tcl-df18ecdce0832c7722af0396d30c814d1cebe3a3.zip tcl-df18ecdce0832c7722af0396d30c814d1cebe3a3.tar.gz tcl-df18ecdce0832c7722af0396d30c814d1cebe3a3.tar.bz2 |
Approximate ms by μs/1000
Diffstat (limited to 'library/tcltest')
-rw-r--r-- | library/tcltest/tcltest.tcl | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 3d8ae5f..1ba3c41 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -1984,11 +1984,8 @@ proc tcltest::test {name description args} { if {!$setupFailure} { # Register startup time - if {[IsVerbose msec]} { - set msStart [clock milliseconds] - } - if {[IsVerbose usec]} { - set usStart [clock microseconds] + if {[IsVerbose msec] || [IsVerbose usec]} { + set timeStart [clock microseconds] } # Verbose notification of $body start @@ -2095,13 +2092,14 @@ proc tcltest::test {name description args} { } } - if {[IsVerbose msec]} { - set elapsed [expr {[clock milliseconds] - $msStart}] - puts [outputChannel] "++++ $name took $elapsed ms" - } - if {[IsVerbose usec]} { - set elapsed [expr {[clock microseconds] - $usStart}] - puts [outputChannel] "++++ $name took $elapsed μs" + if {[IsVerbose msec] || [IsVerbose usec]} { + set t [expr {[clock microseconds] - $timeStart}] + if {[IsVerbose usec]} { + puts [outputChannel] "++++ $name took $t μs" + } + if {[IsVerbose msec]} { + puts [outputChannel] "++++ $name took [expr {round($t/1000.)}] ms" + } } # if we didn't experience any failures, then we passed |