Differences From:
File
tools/cvs2fossil/lib/c2f_pass.tcl
part of check-in
[9a763fe596]
- Reworked time keeping in the pass manager, the microseconds kept by by the 'time' command flow over after roughly 72 minutes (2^32 microseconds). We now use 'clock seconds' to explicitly keep time. This should flow over only after abuut 136 years. The loss of resolution is ok, the converter does not need it. Seconds are good enough.
by
aku on
2007-12-06 04:05:36.
[view]
To:
File
tools/cvs2fossil/lib/c2f_pass.tcl
part of check-in
[be2f99e6a4]
- Merge with aku's branch.
by
drh on
2008-02-13 14:44:50.
Also file
tools/cvs2fossil/lib/c2f_pass.tcl
part of check-in
[7817ff2212]
- Time information extended to include a total summed over all passes. Output extended to include formatted time data (hours, minutes, seconds).
by
aku on
2008-02-12 05:39:21.
[view]
@@ -144,16 +144,33 @@
}
proc ShowTimes {} {
::variable mytime
+ set total 0
foreach {pass seconds} $mytime {
ShowTime $pass $seconds
+ incr total $seconds
}
+ ShowTime Total $total
return
}
proc ShowTime {pass seconds} {
- log write 0 pass "[format %8d $seconds] sec/$pass"
+ if {$seconds > 3600} {
+ set hr [expr {$seconds / 3600}]
+ set min [expr {$seconds % 3600}]
+ set sec [expr {$min % 60}]
+ set min [expr {$min / 60}]
+
+ log write 0 pass "[format %8d $seconds] sec/$pass ([nsp $hr hour] [nsp $min minute] [nsp $sec second])"
+ } elseif {$seconds > 60} {
+ set min [expr {$seconds / 60}]
+ set sec [expr {$seconds % 60}]
+
+ log write 0 pass "[format %8d $seconds] sec/$pass ([nsp $min minute] [nsp $sec second])"
+ } else {
+ log write 0 pass "[format %8d $seconds] sec/$pass"
+ }
return
}
proc Ok? {code label ov {emptyok 1}} {