util::interval_pretty (public)
util::interval_pretty [ -seconds seconds ]
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
Takes a number of seconds and returns a pretty interval of the form "3h 49m 13s"
- Switches:
- -seconds (optional, defaults to
"0"
)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- util__interval_pretty
Source code: set result {} if { $seconds > 0 } { set hrs [expr {$seconds / (60*60)}] set mins [expr {($seconds / 60) % 60}] set secs [expr {$seconds % 60}] if { $hrs > 0 } { append result "${hrs}h " } if { $hrs > 0 || $mins > 0 } { append result "${mins}m " } append result "${secs}s" } return $resultXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql