Menu

[r3]: / lib / CompPerf.CVS / tcl_catch.perf  Maximize  Restore  History

Download this file

88 lines (64 with data), 1.7 kB

#§
#§  CompPerf - tcl_catch.perf
#§
#§  (C) IPN - Ingenieurbuero fuer Praezisionsnumerik
#§
#§  Dipl.-Ing. Andreas Otto
#§  Ulmenstrasse 3
#§  D-34289 Zierenberg
#§  mailto:aotto@t-online.de
#§
#§  Alle Rechte vorbehalten
#§

package require PerfLib

##
## -----------------------------------------------------
## the test-procs
##

proc catch-1 {} {
    catch {set i 0} MSG
}

proc catch-2 {} {
    catch {set i} MSG
}

proc catch-3 {a} {
    catch {set a}
}

proc catch-4 {a} {
    catch {set b}
}

proc catch-5 {a} {
    catch {set b} MSG
}

proc catch-6 {a} {
    catch {set b} MSG
}

proc catch-7 {a} {
    set a 0
}

##
## -----------------------------------------------------
## make the test's
##

set NUM     [ ::PerfLib::Num 1000 ]

set TOTAL   [ time {

    ::PerfLib::Register catch-1 "catch with no error condition"
    ::PerfLib::Run      catch-1 [time {catch-1} $NUM]

    ::PerfLib::Register catch-2 "catch with error condition"
    ::PerfLib::Run      catch-2 [time {catch-2} $NUM]

    ::PerfLib::Register catch-3 "catch with no error condition"
    ::PerfLib::Run      catch-3 [time {catch-3 KKK} $NUM]

    ::PerfLib::Register catch-4 "catch with error condition"
    ::PerfLib::Run      catch-4 [time {catch-4 KKK} $NUM]

    ::PerfLib::Register catch-5 "catch with error condition and variable set"
    ::PerfLib::Run      catch-5 [time {catch-5 KKK} $NUM]

    ::PerfLib::Register catch-6 "catch with no error condition and variable set"
    ::PerfLib::Run      catch-6 [time {catch-6 KKK} $NUM]

    ::PerfLib::Register catch-7 "no catch"
    ::PerfLib::Run      catch-7 [time {catch-7 KKK} $NUM]

} 1 ]

##
## -----------------------------------------------------
## cleanup
##

::PerfLib::Exit

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.