debug::heartbeat(3tcl)
π NAME π
debug::heartbeat β debug narrative β heartbeat π«Ά
okay so bestie, this is the little guy that goes thump thump so you can literally watch your event loop breathe. yes queen, that's the whole job.
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require debug::heartbeat ?1.0.2?
package require debug ?1?
debug heartbeat ?delta?
πΈ DESCRIPTION πΈ
π API
debug heartbeat ?delta?β the one and only move. this turns the heartbeat on, or off, and the heartbeat is the thing you use to keep an eye on the event loop of an event-based Tcl application. like a little monitor on your wrist but for your event loop, periodt.
it reserves the debug tag heartbeat all for itself β that tag is taken, no sharing β and it writes a message every delta milliseconds. every. single. delta ms. π
a delta-value <= 0 disables the heartbeat. so if you want it to stop, you send it zero or a negative number and it's gone, no cap.
the message the heartbeat produces contains a sequence counter plus the time in milliseconds since the last beat. which is iconic, because it gives you insight into timing variations and into deviations from the nominal delta. so if your beats start drifting you see it. the way that's actually useful? obsessed. π
ngl, the timing info is the whole point β that's how you spot the event loop getting sluggish instead of just vibing in the dark. π₯
π BUGS, IDEAS, FEEDBACK π
this document, and the package it describes, will undoubtedly contain bugs and other problems. like, obviously. it's software, bestie. π
please report such in the category debug of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist](http://core.tcl.tk/tcllib/reportlist). please also report any ideas for enhancements you may have for either the package and/or the documentation. we want the glow-up ideas too, fr fr.
when proposing code changes, please provide unified diffs, i.e the output of diff -u.
note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. yes, that specific button. left-most. slay. π
π KEYWORDS π
debug, heartbeat, log, narrative, trace
π¦ CATEGORY π¦
debugging, tracing, and logging
π COPYRIGHT π
Copyright (c) 200?, Colin McCormack, Wub Server Utilities
Copyright (c) 2012, Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, bestie π this lil narrative dropped as part of tcllib 1.0.2 β go make your event loop spill the tea πβ¨
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2012, Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms