/usr/share/tcltk/tcllib1.18/debug/timestamp.tcl is in tcllib 1.18-dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | # -*- tcl -*
# Debug -- Timestamps.
# -- Colin McCormack / originally Wub server utilities
#
# Generate timestamps for debug messages.
# The provided commands are for use in prefixes and headers.
# # ## ### ##### ######## ############# #####################
## Requisites
package require Tcl 8.5
package require debug
namespace eval ::debug {
namespace export timestamp
namespace ensemble create
}
# # ## ### ##### ######## ############# #####################
## API & Implementation
proc ::debug::timestamp {} {
variable timestamp::delta
variable timestamp::baseline
set now [::tcl::clock::milliseconds]
if {$delta} {
set time "${now}-[expr {$now - $delta}]mS "
} else {
set time "${now}mS "
}
set delta $now
return $time
}
# # ## ### ##### ######## ############# #####################
namespace eval ::debug::timestamp {
variable delta 0
variable baseline [::tcl::clock::milliseconds]
}
# # ## ### ##### ######## ############# #####################
## Ready
package provide debug::timestamp 1
return
|