Test package for Tycho packages


TyTest is a Tycho package that contains C code for testing other Tycho C packages.

Contents

::tycho::testtask

::tycho::testtask is a Tcl procedure that implements a C "task" in the structure required by the Tycho Scheduler. All it does is count furiously until its time slice is up, and then sets a Tcl variable to the value of the counter. Although this functionality is rather useless, it does provide an interesting comparison of the relative execution speed of C and Tcl! It has three argument formats:

::tycho::testtask setup countername
Initialize the task: The counter is set to zero. countername is the name of the Tcl variable that will be updated at the end of its time slice.

::tycho::testtask execute
Count for one timeslice -- the time is as set by the Tycho scheduler, and defaults to 20 ms.

::tycho::testtask wrapup
Stop and clean up the task. In this case, nothing needs to be done.

To run a demonstration of the C task:

    source $tycho/src/tytest/testtask.tcl
The top number is the counter incremented by the C task; the bottom one is the counter incremented in Tcl. To more clearly see the interleaving of these two tasks:
    ::tycho::timer period 200

Source files:


Copyright © 1996-1997, The Regents of the University of California. All rights reserved.
Last updated: 05/11/98, comments to: tycho@eecs.berkeley.edu